Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/diffusers/Dockerfile.dreamverse
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ RUN . /opt/venv/bin/activate \
# the exact commit these patches were authored against, so they apply clean.
COPY patches/ltx23_gpu_worker_megacache.patch /tmp/megacache.patch
COPY patches/x264-threads-cap.patch /tmp/x264-threads-cap.patch
COPY patches/pyav-scenecut.patch /tmp/pyav-scenecut.patch
COPY patches/pyav-x264-tuning.patch /tmp/pyav-x264-tuning.patch
COPY patches/flash-attn-cute-fa4-tuple-fix.patch /tmp/flash-attn-cute-fa4-tuple-fix.patch
# NOTE: verify by grepping the patched source, NOT by importing fastvideo --
# importing pulls in triton, which fails to init its driver in a GPU-less build
# ("0 active drivers").
RUN SP=/opt/venv/lib/python3.12/site-packages \
&& patch -p1 -d "$SP" --forward --fuzz=0 < /tmp/megacache.patch \
&& patch -p1 -d "$SP" --forward --fuzz=0 < /tmp/x264-threads-cap.patch \
&& patch -p1 -d "$SP" --forward --fuzz=0 < /tmp/pyav-scenecut.patch \
&& patch -p1 -d "$SP" --forward --fuzz=0 < /tmp/pyav-x264-tuning.patch \
&& patch -p1 -d "$SP" --forward --fuzz=0 < /tmp/flash-attn-cute-fa4-tuple-fix.patch \
&& grep -q 'torch.compiler.load_cache_artifacts' "$SP/fastvideo/worker/gpu_worker.py" \
&& grep -q 'FASTVIDEO_X264_THREADS' "$SP/fastvideo/entrypoints/video_generator.py" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/fastvideo/entrypoints/video_generator.py b/fastvideo/entrypoints/vi
index bfc1633..ef4f213 100644
--- a/fastvideo/entrypoints/video_generator.py
+++ b/fastvideo/entrypoints/video_generator.py
@@ -1010,6 +1010,12 @@ class VideoGenerator:
@@ -1010,6 +1010,20 @@ class VideoGenerator:
video_stream.options = {
"preset": "ultrafast",
"tune": "zerolatency",
Expand All @@ -12,6 +12,14 @@ index bfc1633..ef4f213 100644
+ # FASTVIDEO_X264_PRESET below) so it's opt-out per model without
+ # a rebuild. Measured ~50-100ms/clip (deepinfra, 2026-07-07).
+ "x264-params": f"scenecut={os.getenv('FASTVIDEO_X264_SCENECUT', '0')}",
+ # Cap x264 threads. B200 has no NVENC so this is CPU libx264;
+ # unbounded, x264 auto-detects all node cores (~288) -> thread
+ # thrash. Isolated encode-only sweep (deepinfra 2026-07-09, 121f
+ # 1080p) bottoms out ~10-12 threads (~0.42s) and gets WORSE past
+ # 16 (0.64s+); 12 = sweet spot AND well under a fair share. The
+ # ffmpeg-pipe path caps at 32 but is dead on B200 (no ffmpeg on
+ # PATH). Env-configurable, no rebuild to change.
+ "threads": os.getenv("FASTVIDEO_X264_THREADS_PYAV", "12"),
}

audio_stream = output.add_stream("aac", rate=sample_rate, layout=layout)
Loading