I need to understand whether the LTX video model (introduced via an upstream Wan2GP sync…
- User
I need to understand whether the LTX video model (introduced via an upstream Wan2GP sync in PR #16 on banodoco/Reigh-Worker) can work with the existing "video travel" feature by just specifying the model name, or if code changes are needed.
The PR is on branch
claude/sync-fork-with-upstream-Ky1dZ. The repo is at/Users/user_c042661f/Documents/Headless-Wan2GP.Do this research:
-
First, fetch the LTX default config files from the PR branch to understand what LTX models look like:
Wan2GP/defaults/ltx2_19B.jsonWan2GP/defaults/ltx2_distilled.json
-
Compare with an existing Wan model config that works with video travel (e.g., any
i2vorwanconfig inWan2GP/defaults/). -
Look at how the codebase determines model type and dispatches generation. Key files:
source/models/wgp/orchestrator.py— how it picks generation strategysource/models/wgp/generators/generation_strategies.py— the actual generation strategiessource/task_handlers/travel/orchestrator.py— travel orchestratorsource/task_handlers/travel/segment_processor.py— how segments are generatedsource/task_handlers/tasks/task_registry.py— how tasks map to model types
-
Look at how model names/types flow through the system. Search for things like:
- How "model_name" or model type is used to decide code paths
- Any hardcoded model name checks (e.g.,
if "wan" in model_nameorif "ltx" in ...) - The
defaultsloading mechanism in the vendored Wan2GP code
-
Check the upstream Wan2GP changes for any LTX-specific generation code paths:
- Look at
Wan2GP/models/for any new LTX-related model files - Check
Wan2GP/wgp.pyor similar for how LTX is handled differently from Wan
- Look at
The key question: Does the video travel pipeline make any model-specific assumptions (frame counts, resolution constraints, i2v behavior, etc.) that would break with LTX? Or is it model-agnostic enough that specifying "ltx2_19B" as the model would Just Work?
Report back with:
- What LTX model configs look like vs Wan configs
- Any model-specific code paths in our code that would need updating
- Any LTX-specific behavior in the vendored Wan2GP code
-
Assistant
I'll systematically research this. Let me start by examining the LTX config files, existing Wan configs, and the key code paths.
Assistant
Let me start by fetching the LTX configs from the PR branch and listing existing Wan configs.
Assistant
The branch isn't local. Let me check the upstream remote and the PR. Since the PR is on banodoco/Reigh-Worker, let me look at the upstream branches and see if the LTX configs exist there.
Assistant
The config names are slightly different from what was mentioned (ltxv not ltx2). Let me fetch these, and also check the PR itself.
Assistant
Now let me also check the PR for the exact branch name and configs. Let me also check if there's a newer dev branch with ltx2 configs.
Assistant
This is the upstream Wan2GP repo's PRs, not Reigh-Worker. The PR #16 is on banodoco/Reigh-Worker specifically. Let me check with the proper repo flag.
Assistant
So the PR has
ltx2configs (newer than upstream main'sltxv). Let me fetch them from the remote branch.Assistant
Empty output. Let me try fetching from the API directly.
Assistant
It's from a fork (xliry). Let me try that.
Assistant
Now let me fetch the distilled config and start reading the key codebase files in parallel.
Assistant
Now let me read the existing Wan configs and the key source files in parallel.
Assistant
Now let me read the key files in parallel: Wan i2v config, our orchestrator, generation strategies, travel orchestrator, segment processor, and task registry.
Assistant
Now let me read the [REDACTED] file (is_vace, is_flux, is_t2v) and the other critical files in parallel.
Assistant
This is a critical finding. Line 237:
is_t2valready includes"ltxv_13B"in its check. But the new LTX-2 config has architecture"ltx2_19B"-- not"ltxv_13B". Let me now read the other key files.Assistant
Let me search for model-specific references in the travel orchestrator and segment processor more efficiently.
Assistant
Now let me read the segment processor, generation_strategies, task_registry, and svi_config in parallel.
Assistant
Now let me look at the generation strategies and the key upstream vendored code in parallel.
Assistant
Now let me search for hardcoded model name checks throughout the codebase and examine the upstream vendored code.
Assistant
Now let me look at the lora_paths.py for the LTX-specific path, the task_conversion for how model names are resolved, and check the upstream wgp.py for how it handles LTX/model types.
Assistant
Now let me check the upstream Wan2GP code for LTX-specific model handling.
Assistant
Very important. Let me see key parts of wgp.py more closely, particularly the
get_base_model_typefunction and the family handler for LTX.Assistant
Now let me look at how
model_types_handlersis populated and what the LTX handler looks like.Assistant
Now let me check the LTX handler to see what model types it registers.
Assistant
This is the CURRENT upstream code. The handler only supports
"ltxv_13B". But the PR adds configs with architecture"ltx2_19B". Let me check the PR's version of this handler.Assistant
The PR's version of
ltxv_handler.pySTILL only registers"ltxv_13B"as supported type! But the LTX-2 configs have architecture"ltx2_19B". This means there should be a separate LTX-2 handler. Let me check.Assistant
No handler changes in the PR. Let me check if the wgp.py in the PR has the ltx2_19B support.
Assistant
The PR does NOT include any changes to
wgp.py,ltxv_handler.py, or any newltx2_handler.py. This means the PR is relying on the upstream Wan2GP code already handlingltx2_19B. Let me check if the PR'swgp.pyalready has ltx2 support by checking the upstream more carefully.Assistant
There it is. The PR's
wgp.pyadds"models.ltx2.ltx2_handler"as a new family handler. Let me check what that handler contains.Assistant
Excellent. Now I have a very clear picture. Let me also check a few more things about how the travel pipeline uses frame counts and the
4N+1constraint.Assistant
Let me search for the 4N+1 frame constraint and how it applies to different models, and also check the wgp.py from the PR for ltx2-specific code paths.
Assistant
Let me check the frame quantization logic in the travel orchestrator more closely.
Assistant
The travel orchestrator hardcodes the
4N+1frame quantization. But LTX/LTX-2 models use8N+1(frames_steps=8). Let me verify this more carefully.Assistant
Now let me check the wgp.py from the PR for how it handles video_length quantization for ltx2.
Assistant
Let me now look at how wgp.py handles the video_length alignment in the generate path, specifically the
(x-1)//4*4+1or similar for LTX.Assistant
Key finding at line 5951-5952: WGP internally does
video_length = (video_length -1) // latent_size * latent_size + 1wherelatent_sizecomes fromframes_stepswhich is 8 for LTX models. So WGP auto-corrects frame counts. But our travel pipeline hardcodes the4N+1rule before passing to WGP.Let me check a few more key areas: the
snap_resolution_to_model_gridfunction and how resolution constraints differ for LTX.Assistant
Good -- resolution snaps to 16, which is fine for LTX (its VAE uses 32 or 64 block sizes, but WGP handles that internally).
Now let me check the key
ltx2vsltxv_13Brefs in wgp.py from the PR to understand ifltx2_19Bis treated as havingi2v_class,vace_class,t2v_classetc.Assistant
The PR's
wgp.pyonly references"ltxv_13B"in hardcoded checks, NOT"ltx2_19B". Let me check a few of those critical spots.Assistant
Now let me check the critical
i2v_class/vace_class/t2v_classflags forltx2_19B. These are set in the config JSON or by the handler.Assistant
These come from
model_def.get("i2v_class", False)etc., which are set in the JSON config files. The LTX-2 config JSON does NOT include anyi2v_class,t2v_class, orvace_classfields. And the handler'squery_model_defdoesn't set them either. This means:test_class_i2v("ltx2_19B")->Falsetest_vace_module("ltx2_19B")->Falsetest_class_t2v("ltx2_19B")->False
Now let me check what LTX-2 supports in terms of start/end images (which travel uses).
Assistant
The ltx2_handler sets
image_prompt_types_allowed = "TSEV"which means it supports:- T = text prompt (start image as text prompt)
- S = start image
- E = end image
- V = video source
This is the same as
ltxv_13B. LTX-2 supports start and end images. Now let me check one more thing -- how theis_t2vcheck in our code affects the generate path.Assistant
Let me do a few final checks -- the task_conversion.py to see how model names are mapped, and the lora path resolution for ltx2.
Assistant
Let me check where the model from DB task is resolved at the top.
Assistant
The model comes directly from
db_task_params.get("model")-- meaning the travel orchestrator sets the model name and it flows through. This means the travel orchestrator can setmodel_name: "ltx2_19B"and it will be passed to WGP.Now let me verify one final critical thing: the
_detect_vace_modelin the segment processor uses string matching.The segment processor's
_detect_vace_model(line 62-71 of segment_processor.py) checks for keywords:"vace","controlnet","cocktail","lightning". The ltx2 model name"ltx2_19B"or"LTX-2 Dev 19B"would NOT match any of those, sois_vace_modelwill beFalse. This is correct since LTX-2 is not a VACE model.Assistant
Now let me do one last check to make sure I haven't missed any hardcoded model checks in the resolution snapping code or the frame calculation logic.
Assistant
Good. Our
snap_resolution_to_model_gridsnaps to multiples of 16. LTX-2'sget_vae_block_sizereturns 64, which means WGP may need resolutions that are multiples of 64. But WGP handles that internally -- our code just needs to pass a reasonable resolution and WGP will adjust.Let me also check if there's anything in how
travel_modeis determined that would be incompatible.Assistant
- User
Assistant
I'll conduct a thorough end-to-end analysis of LTX-2 compatibility with the Headless-Wan2GP pipeline. Let me start by fetching the LTX-2 handler and examining the key pipeline files in parallel.
Assistant
Good, I have the full LTX-2 handler. Now let me fetch the key pipeline files in parallel.
Assistant
Now let me read the key files in parallel for the remaining analysis areas.
Assistant
Now let me read the travel pipeline, stitch, ffmpeg, and other key files in parallel.
Assistant
Now let me read more key files in parallel.
Assistant
Now let me check more key files related to model detection, resolution, LoRA setup, and the generation helpers.
Assistant
Very important finding in
generation_helpers.py-is_t2v()already includes"ltx2_19B"in its list. Now let me check the LoRA setup, model_ops, param_resolution, and the travel orchestrator.Assistant
Now let me look at the travel orchestrator to check how fps_helpers is set, and how segment frames are calculated.
Assistant
Now I can see that
fps_helpersdefaults to 16 everywhere. Let me check where it's originally set in the orchestrator payload.Assistant
So
fps_helpersis not set by the pipeline itself -- it comes from the task payload (user/API). The fallback is always 16. Let me check how the audio-related code paths work, check the SVI config, and look at structure video loading.Assistant
Let me now check the output handling and how WGP returns audio, and also check the generators directory and structure handling.
Assistant
Now let me check the
_detect_vace_modellogic more carefully since LTX-2 is NOT a VACE model but uses guide videos.Assistant
Critical finding! Let me examine how the travel pipeline decides whether to use SVI mode vs VACE mode, and how it generates segments for non-VACE models.
Assistant
Now let me check a few more critical areas. Let me look at how segment generation constructs the actual WGP call parameters, especially for non-VACE models, and how sliding window interacts.
Assistant
Now let me check the SVI segment generation path and how it sets image_prompt_type.
Assistant
Now let me look at the structure guidance handling and how the WGP
wgp.pyis checked for thegenerate_videosignature.Assistant
Now let me check a few more things - how the model's VACE status is determined for queue routing, and how LoRA multipliers are parsed.
Assistant
Now let me check the LoRA multiplier parsing in the core params.
Assistant
Now let me check the
_anflag (no audio) in ffmpeg ops - critical for audio handling.Assistant
Let me also check the crossfade and stitch functions for audio handling.
Assistant
Good. Now let me check the structure video handling for model-specific issues.
Assistant
Let me now look at whether the
force_fps='auto'in wgp_params triggers WGP to use the model's fps (24 for LTX-2), and check how WGP returns output for audio-enabled models.Assistant
Good,
force_fps='auto'is hardcoded which means WGP will use the model's native FPS. Let me check how WGP saves output and whether it saves to file_list.Assistant
Now let me check what file extension WGP saves for LTX-2. Let me also see whether our video processing handles
.mp4files with audio streams.Assistant
Let me check the segment_processor's
_structure_configand_detected_structure_typeto ensure they exist.Assistant
Now let me do one final check - the safety check in preflight.py that boosts video_length <5 to 5. LTX-2 has
frames_minimum=17, so our pipeline needs to ensure segments are at least 17 frames.Assistant
The safety check only boosts to 5, but LTX-2 requires minimum 17. Let me check whether WGP itself handles that minimum.
Assistant
Good. The orchestrator calls
get_model_min_frames_and_step()and usesframes_stepfor quantization. But it only quantizes to step*N+1 -- it does NOT enforce the minimum frame count. Let me verify this.Assistant
The orchestrator gets
_min_framesfrom WGP but assigns it to an underscore-prefixed variable and never uses it. This is a potential issue.Now let me check a last few things - how the VACE detection for segment processor works, and how LTX-2 guide preprocessing is handled by WGP itself (since it's not VACE).
Assistant
Let me update all tasks and now compile the report.
Assistant