Skip to content

Commit 5179983

Browse files
committed
Update README.md
1 parent c104d04 commit 5179983

File tree

1 file changed

+99
-68
lines changed

1 file changed

+99
-68
lines changed

README.md

Lines changed: 99 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
1-
2-
<img width="353" height="347" alt="image" src="https://github.com/user-attachments/assets/69054332-b01e-4c54-a75b-7dc5cd683930" />
3-
4-
51
# WanVideoLooper Nodes for ComfyUI
62

7-
This is a set of custom nodes for ComfyUI designed for generating sequential long video clips based on the Wan 2.2 model architecture, handling continuity between segments and offering advanced control over the sampling process, including per-segment LoRA/model application.
8-
9-
This pack contains two nodes:
3+
This is a set of custom nodes for ComfyUI designed for generating sequential long video clips, handling continuity between segments, and offering advanced control over the sampling process, including per-segment LoRA/model application.
104

11-
---
5+
This pack contains **three** nodes:
126

137
1. **`WanVideo Looper`**: The main node that takes base models, a list of prompts, and various settings to generate a sequence of video clips, merging them seamlessly.
14-
15-
<img width="299" height="641" alt="image" src="https://github.com/user-attachments/assets/2707f409-a254-4418-9656-4b2627d8c3f6" />
8+
2. **`WanVideo Looper Prompts`**: A new helper node for managing multiline positive prompts, a global negative prompt, prefixes/suffixes, and saving/loading prompt profiles.
9+
3. **`WanVideo Looper Lora Sequencer`**: A helper node designed to feed pre-patched Model and CLIP objects into the `WanVideo Looper` for specific segments, enabling per-segment LoRA application.
1610

17-
---
18-
19-
2. **`WanVideo Looper Lora Sequencer`**: A helper node designed to feed pre-patched Model and CLIP objects into the `WanVideo Looper` for specific segments, enabling per-segment LoRA application.
20-
21-
<img width="307" height="373" alt="image" src="https://github.com/user-attachments/assets/74d0ab47-a6ef-4dd6-90bd-cb7902f66a3a" />
11+
<img width="353" height="347" alt="image" src="https://github.com/user-attachments/assets/69054332-b01e-4c54-a75b-7dc5cd683930" />
2212

2313
---
2414

25-
**Watch the Tutorial Video:**
15+
**Watch the Tutorial Video (Original):**
16+
*(Note: This video may be for an older version but can still be helpful for understanding the core concepts.)*
2617

2718
<a href="https://www.youtube.com/watch?v=jztckgdkCHc">
28-
<img src="https://img.youtube.com/vi/jztckgdkCHc/maxresdefault.jpg"
29-
alt="Watch the tutorial video"
30-
width="480" height="270" border="0" />
19+
  <img src="https://img.youtube.com/vi/jztckgdkCHc/maxresdefault.jpg" 
20+
       alt="Watch the tutorial video" 
21+
       width="480" height="270" border="0" />
3122
</a>
3223

3324
---
@@ -37,84 +28,124 @@ This pack contains two nodes:
3728
1. Navigate to your ComfyUI installation directory.
3829
2. Go into the `ComfyUI/custom_nodes/` folder.
3930
3. Create a new folder inside `custom_nodes` named **`WanVideoLooper`**.
40-
4. Place all three files (`wan_looper_node.py`, `wan_lora_sequencer.py`, and `__init__.py`) inside the new `WanVideoLooper` folder.
41-
5. **Restart your ComfyUI server.**
31+
4. Place all the `.py` files inside the new `WanVideoLooper` folder:
32+
* `__init__.py`
33+
* `wan_looper_node.py`
34+
* `wan_lora_sequencer.py`
35+
* `wan_prompts_node.py`
36+
5. Create a `js` subfolder inside your new folder: `ComfyUI/custom_nodes/WanVideoLooper/js`.
37+
6. Place all the `.js` files inside that `js` folder:
38+
* `wan_lora_sequencer.js`
39+
* `wan_prompts_node.js`
40+
7. **(Required for Color Match)** Open a terminal or command prompt, activate your ComfyUI virtual environment (if you use one), and run:
41+
```bash
42+
pip install color-matcher
43+
```
44+
8. **Restart your ComfyUI server.**
4245

4346
The nodes will be available by right-clicking the canvas and selecting **Add Node > WanVideoLooper**.
4447

4548
---
4649

4750
## 1. WanVideo Looper
4851

49-
This is the core node for generating video sequences segment by segment. It intelligently handles continuity and uses an advanced MoE-style sampling approach suitable for Wan 2.2 dual-model setups.
52+
This is the core node for generating video sequences segment by segment. It intelligently handles continuity and uses an advanced MoE-style sampling approach.
53+
54+
<img width="268" height="608" alt="image" src="https://github.com/user-attachments/assets/0fdb8552-ec6d-4e7c-b0fa-ee2b5a455dc9" />
5055

5156
### Features
5257

53-
* **In-Memory Looping:** Processes segments entirely in memory for efficiency.
54-
* **Prompt List Input:** Takes a list of positive prompts (e.g., from the `MultiString Prompt` node), generating one segment per prompt.
55-
* **Seamless Continuity:** Uses frame merging (`frame_merge`) to ensure smooth transitions between segments based on the last frame(s) of the previous segment.
56-
* **MoE-Style Sampling:** Integrates Mixture of Experts logic with a single `steps` input and automatic calculation of the split point (`model_switch_point`) between high-noise and low-noise models.
57-
* **Advanced Controls:** Includes `sigma_shift`, separate `cfg_high_noise` / `cfg_low_noise`, and an optional `cfg_motion_step` for fine-tuning the first step's guidance.
58-
* **Variable Duration:** Allows setting segment duration (`duration_sec`), although 5 seconds is recommended for model consistency.
59-
* **Per-Segment Models/LoRAs:** Supports an optional input from the `WanVideo Lora Sequencer` to use completely different, pre-patched models (with LoRAs applied) for specific segments.
60-
* **Dry Run Mode:** Includes an `enable_dry_run` toggle to quickly test setup and logs without performing sampling/decoding.
58+
* **Prompt List Input:** Takes a `prompt_list` and `negative_prompt` directly from the `WanVideo Looper Prompts` node.
59+
* **Seamless Continuity:** Uses frame merging (`frame_merge`) to ensure smooth transitions between segments.
60+
* **MoE-Style Sampling:** Integrates Mixture of Experts logic with a single `steps` input and automatic calculation of the split point (`model_switch_point`).
61+
* **Internal Color Matching:** Can apply MKL color matching between segments (`color_match`) or match the entire video to the very last frame (`color_match_lastframe`) to fix color drift. Requires `pip install color-matcher`.
62+
* **Per-Segment Models/LoRAs:** Supports an optional input from the `WanVideo Lora Sequencer` to use different, pre-patched models for specific segments.
63+
* **Dry Run Mode:** Includes an `enable_dry_run` toggle to quickly check setup and logs without performing sampling/decoding.
6164

6265
### Inputs & Outputs
6366

6467
* **Required Inputs**
65-
* `model_high`: The BASE high-noise model (can be pre-patched with global LoRAs).
66-
* `model_low`: The BASE low-noise model (can be pre-patched with global LoRAs).
67-
* `clip`: The BASE CLIP model (can be pre-patched with global LoRAs).
68-
* `vae`: The VAE model used for decoding the final image.
69-
* `start_image`: The seed image that the first loop will start from.
70-
* `positive_prompts`: Connect the 'prompt_list' output from the MultiString Prompt node.
71-
* `negative_prompt`: A single, global negative prompt applied to all loops.
72-
* `seed`: The random seed. This will be used for all loops unless overridden by future features.
68+
* `model_high`: The BASE high-noise model.
69+
* `model_low`: The BASE low-noise model.
70+
* `clip`: The BASE CLIP model.
71+
* `vae`: The VAE model used for decoding.
72+
* `start_image`: The seed image for the first loop.
73+
* `positive_prompts`: Connect the `prompt_list` output from the `WanVideo Looper Prompts` node.
74+
* `negative_prompt`: Connect the `negative_prompt` output from the `WanVideo Looper Prompts` node.
75+
* `seed`: The random seed.
7376
* `steps`: The total number of sampling steps for each loop.
74-
* `enable_motion_cfg`: Enable a separate CFG for the very first step to control motion.
75-
* `cfg_motion_step`: CFG for the first step ONLY. A value > 1.0 will engage the negative prompt for initial motion guidance.
76-
* `cfg_high_noise`: CFG for the high-noise model (structure/motion). 1.0 disables guidance.
77-
* `cfg_low_noise`: CFG for the low-noise model (details). 1.0 disables guidance.
78-
* `sampler_name`: The sampling algorithm (e.g., dpmpp_2m_sde_gpu).
79-
* `scheduler`: The noise scheduler (e.g., karras).
80-
* `model_switch_point`: Timestep to switch from high-noise to low-noise model. 0.9 (I2V) or 0.875 (T2V) recommended.
81-
* `sigma_shift`: Applies sigma shift to both models. 8.0 is a good default.
82-
* `denoise`: Denoise amount. 1.0 means generate a full new image.
83-
* `width`: The width of the output video.
84-
* `height`: The height of the output video.
85-
* `frame_merge`: Number of frames to overlap/merge between loops for smooth transitions.
86-
* `duration_sec`: Duration of each segment in seconds. 5s is recommended, max 10.
87-
* `enable_dry_run`: If enabled, skips sampling and decoding to quickly check setup and logs.
77+
* `enable_motion_cfg`: Enable a separate CFG for the very first step.
78+
* `cfg_motion_step`: CFG for the first step ONLY.
79+
* `cfg_high_noise`: CFG for the high-noise model (structure/motion).
80+
* `cfg_low_noise`: CFG for the low-noise model (details).
81+
* `sampler_name`: The sampling algorithm.
82+
* `scheduler`: The noise scheduler.
83+
* `model_switch_point`: Timestep to switch from high-noise to low-noise model (e.g., 0.9).
84+
* `sigma_shift`: Applies sigma shift to both models (e.g., 8.0).
85+
* `denoise`: Denoise amount (1.0 = full new image).
86+
* `width`/`height`: The output video dimensions.
87+
* `frame_merge`: Number of frames to overlap/merge between loops.
88+
* `duration_sec`: Duration of *each* segment in seconds (5s recommended).
89+
* `color_match`: (New!) Enable segment-to-segment MKL color matching.
90+
* `color_match_lastframe`: (New!) Override `color_match` and instead match all frames to the *very last* frame of the sequence.
91+
* `color_match_strength`: (New!) Strength of the color match (0.0 to 1.0).
92+
* `enable_dry_run`: Skips sampling and decoding to quickly check setup.
8893
* **Optional Inputs**
8994
* `clip_vision`: (Optional) A CLIP Vision model for guiding the start image.
90-
* `model_clip_sequence`: (Optional) Connect a WanVideo Lora Sequencer to use different pre-patched models/clips per segment.
95+
* `model_clip_sequence`: (Optional) Connect the `WanVideo Lora Sequencer` output here.
96+
* `color_match_ref`: (New!) (Optional) A static reference image for color matching. If omitted, uses the last frame of the previous segment.
9197
* **Outputs**
9298
* `images`: The final, concatenated batch of all generated video frames.
93-
* `last_frame`: The single, very last frame of the entire sequence. Useful for reference in subsequent nodes (e.g., Color Match).
99+
* `last_frame`: The single, very last frame of the entire sequence.
94100

95101
---
96102

97-
## 2. WanVideo Looper Lora Sequencer
103+
## 2. WanVideo Looper Prompts
98104

99-
This helper node allows you to specify different, pre-patched Model and CLIP objects for each segment of your video sequence. It's the key to applying different LoRAs to different parts of your video when using the `WanVideo Looper`.
105+
A helper node to manage all your prompts, prefixes, and profiles in one place.
100106

101-
### What It Does
107+
<img width="471" height="621" alt="image" src="https://github.com/user-attachments/assets/60b79704-47d7-4aea-8ed8-cb442d5167e1" />
102108

103-
* **Segment Inputs:** Provides 5 sets of optional inputs (`model_high_X`, `model_low_X`, `clip_X`) corresponding to the 5 potential prompt segments.
104-
* **Uses Standard Nodes:** You patch your models using standard ComfyUI nodes (`Load LoRA`, `Lora Stacker`, `Power Lora`, etc.) outside the sequencer.
105-
* **Clean Looper:** You connect the *output* of your patching nodes (the patched MODEL and CLIP) into the corresponding inputs on this sequencer. This keeps the main `WanVideo Looper` node uncluttered.
106-
* **Bundles Inputs:** The sequencer simply bundles these potentially connected models/clips into a list.
107-
* **Fallback:** If you leave the inputs for a specific segment unconnected on the sequencer, the `WanVideo Looper` will automatically fall back to using the clean base models for that segment.
109+
### Features
110+
111+
* **Multiline Prompts:** Enter one positive prompt per line. Each line becomes a new video segment. Empty lines are ignored.
112+
* **Global Negative Prompt:** A single multiline text box for your negative prompt.
113+
* **Prefix/Suffix:** Automatically add text (like `masterpiece,`) *before* and *after* every single prompt (positive and negative) with a toggle to enable or disable.
114+
* **Profile Management:** Save your complex prompt setups (positive, negative, prefix, suffix) to named profiles in your browser's `localStorage`.
115+
* **Save/Load/Delete:** Easily save new profiles, load existing ones from a dropdown, and delete old profiles.
108116
109117
### Inputs & Outputs
110118
111-
* **Optional Inputs (15 total)**
112-
* `model_high_1` to `model_high_5`: The pre-patched HIGH model for each segment.
113-
* `model_low_1` to `model_low_5`: The pre-patched LOW model for each segment.
114-
* `clip_1` to `clip_5`: The pre-patched CLIP model for each segment.
119+
* **Inputs (Widgets)**
120+
* `prompts`: Multiline text for positive prompts (one per line).
121+
* `negative_prompt`: Multiline text for the global negative prompt.
122+
* `enable_prefix_suffix`: A "true"/"false" toggle.
123+
* `prefix`: Text to add before each prompt.
124+
* `suffix`: Text to add after each prompt.
125+
* *(Profile controls for saving/loading)*
115126
* **Outputs**
116-
* `model_clip_sequence`: A list containing 5 tuples. Each tuple holds `(model_high, model_low, clip)` for the corresponding segment, or `None` if an input was not connected. This output connects directly to the `model_clip_sequence` input on the `WanVideo Looper`.
117-
127+
* `prompt_list`: A list of processed positive prompts, ready for the main looper node.
128+
* `negative_prompt`: The single, processed negative prompt string.
118129
119130
---
120131
132+
## 3. WanVideo Looper Lora Sequencer
133+
134+
This helper node allows you to specify different, pre-patched Model and CLIP objects for each segment of your video sequence. It's the key to applying different LoRAs to different parts of your video.
135+
136+
<img width="225" height="112" alt="image" src="https://github.com/user-attachments/assets/f50eaaf3-3282-4d95-ac54-ba3c034d53d7" />
137+
138+
### Features
139+
140+
* **Segment Inputs:** Provides **10** sets of optional inputs (`model_high_X`, `model_low_X`, `clip_X`) corresponding to the first 10 prompt segments.
141+
* **Dynamic Inputs:** The node's UI is dynamic. It only shows inputs for segments that are connected. Connect segment 1 to see segment 2, and so on.
142+
* **Clean Workflow:** You patch your models using standard ComfyUI nodes (`Load LoRA`, etc.) *outside* the sequencer. Connect the final patched MODEL and CLIP into the corresponding inputs on this node.
143+
* **Bundles Inputs:** The sequencer bundles these connected models/clips into a list for the main looper.
144+
* **Fallback:** If you leave the inputs for a specific segment unconnected, the `WanVideo Looper` will automatically fall back to using the clean base models for that segment.
145+
146+
### Inputs & Outputs
147+
148+
* **Optional Inputs (30 total)**
149+
* `model_high_1` to `model_high_10`: The pre-patched HIGH model for each segment.
150+
* `model_low_1` to `model_low_10`: The pre-patched LOW model for each segment.
151+
* `clip_1` to `clip_10`: The pre-patched CLIP

0 commit comments

Comments
 (0)