Skip to content

Commit

Permalink
add more fine granular subtitle positions
Browse files Browse the repository at this point in the history
less text per paragraph segment / image gen and subtitle.
  • Loading branch information
Chris Kennedy committed Mar 27, 2024
1 parent 2b20a5c commit b20c18d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions scripts/twitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ MODEL_ID=7b-it
# Generic settings
USE_API=1
CHAT_FORMAT=chatml
MAX_TOKENS=1500
MAX_TOKENS=2000
TEMPERATURE=0.8
CONTEXT_SIZE=8000
QUANTIZED=0
KEEP_HISTORY=1
SD_MAX_LENGTH=50
## Pipeline Settings
DAEMON=1
CONTINUOUS=1
Expand All @@ -39,13 +40,14 @@ TWITCH_LLM_CONCURRENCY=1
TWITCH_CHAT_HISTORY=16
TWITCH_MAX_TOKENS=120
## Stable Diffusion Settings
SD_TEXT_MIN=70
SD_WIDTH=512
SD_HEIGHT=512
SD_API=1
SD_MODEL=turbo
SD_INTERMEDIARY_IMAGES=1
SD_N_STEPS=20
ALIGNMENT=right
ALIGNMENT=center
SUBTITLES=1
# === END OF CONFIGURATION ===
#
Expand Down Expand Up @@ -121,6 +123,8 @@ DYLD_LIBRARY_PATH=`pwd`:/usr/local/lib:$DYLD_LIBRARY_PATH \
--ndi-timeout $NDI_TIMEOUT \
$USE_API_CMD \
$USE_CANDLE_CMD \
--sd-text-min $SD_TEXT_MIN \
--sd-max-length $SD_MAX_LENGTH \
--llm-history-size $CONTEXT_SIZE \
--chat-format $CHAT_FORMAT \
--model-id $MODEL_ID \
Expand Down
6 changes: 4 additions & 2 deletions src/ndi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ pub fn send_images_over_ndi(
subtitle_height = height as i32 - (height as i32 / 2) / 2;
} else if subtitle_position == "center" || subtitle_position == "middle" {
subtitle_height = height as i32 - (height as i32 / 2);
} else if subtitle_position == "mid-bottom" {
} else if subtitle_position == "low-center" {
subtitle_height = height as i32 - (height as i32 / 3);
} else if subtitle_position == "bottom" {
} else if subtitle_position == "mid-bottom" {
subtitle_height = height as i32 - (height as i32 / 4);
} else if subtitle_position == "bottom" {
subtitle_height = height as i32 - (height as i32 / 5);
} else {
log::error!(
"Invalid subtitle position '{}', using default position bottome as value {} instead.",
Expand Down

0 comments on commit b20c18d

Please sign in to comment.