install_comfyui.sh becomes install_backend.sh and now builds everything the app
needs, not just the speech half:
- Step 7 runs normalizer/setup.sh --model, which fetches both models: the open
inflection model first, so the install gets as far as it can before anything
can ask for credentials, then the gated fine-tune.
- A missing Hugging Face account is no longer fatal. Accepting a licence is the
one thing an installer cannot do, so the rest installs, the verification
reports "fallback only (gated model missing)", and the summary prints the
three commands that finish it.
- --skip-normalizer, disk requirement 35 -> 55 GB, removal instructions and the
step list updated to match.
Queue logging — queue.log in the first queued video's job folder, which for a
single-video run is its own:
- Records what went wrong rather than what happened: warnings, tracebacks,
ffmpeg errors, guard rejections, clips cut off mid-word or that crashed the
backend, and the --regen line carrying their numbers.
- ComfyUI failures *and* restarts, so the log shows the recovery rather than
reading as though the run simply stopped. GUI-initiated backend actions go in
too; they never pass through a job's pipe.
- A failure also dumps the job's last 15 lines. Keyword matching alone is not
enough — ffmpeg says "Invalid data found when processing input" and nothing
that looks like an error.
UI:
- The output pane follows new output only while already at the bottom. Scroll up
and it stays there; scroll back down and it resumes. Reading an earlier
warning during a run was impossible while every ffmpeg progress frame yanked
the view to the end.
- The ComfyUI button's status dot is drawn as its own canvas item, so it can be
green (answering) or amber (holds the port, does not answer). A "." inside the
label could only ever be the same grey as the words.
comfyui.log is capped at 120,000 lines, trimmed on backend start and every five
minutes. Rewritten in place, never replaced: tee holds it open in append mode,
so swapping the inode would leave the backend writing to an unlinked file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Text processing before TTS:
- dictionary.txt rewrites words and phrases (km/h, np., units). Rules compile
into one alternation applied in a single pass, so replacements never chain
and longest-literal wins. Case-sensitive, whole-word.
- A per-queue second dictionary, written by the GUI into the first video's job
folder and merged with the shared one (--dictionary-extra).
- ALL-CAPS blocks become Title Case rather than sentence case: lowercasing
destroyed proper nouns inside captions ("NASA - MARGO MADISON") and invited
the normalizer to "correct" the name. Paired clips in output/clips/all-caps
showed the TTS reads both casings the same.
normalizer/ — digits to spoken Polish, in its own venv because it needs
transformers>=5, which must not touch ComfyUI's pinned versions:
- Two backends. Plain integers go to num2words for the value and a general
Polish LLM for the case; times, dates, decimals and identifiers go to a 0.6B
fine-tune. Measured on 40 real subtitle lines, each is clearly better than
the other on its half. 74% of numbered blocks take the first leg.
- Guards on every answer: runaway length, repetition loops, invalid bytes,
leftover digits, a lost minus sign, a changed number, a lost word. A failure
falls back to num2words, which is nominative but never wrong about the value.
- ComfyUI is asked to unload before normalizing; a normalizer that does not fit
in VRAM is spilled to RAM silently at 5x the cost.
Backend lifecycle:
- ComfyUI is found by port through /proc, so a backend started by hand is
managed too. SIGTERM escalates to SIGKILL, and a suspended process is killed
outright since it never runs its handlers.
- A clip that kills the backend is retried three times, each with a different
seed (the aborts are seed-dependent, not text-dependent), then skipped and
reported so an overnight queue keeps moving.
- start_comfyui.sh execs python, so the script's PID is ComfyUI's.
- GUI gains ComfyUI and Queue dictionary buttons; quitting stops the backend.
--resume-from now reuses the job folder's tts_input.srt instead of reparsing
the subtitles, so block N still pairs with clip_NNNN.flac.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>