You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
10
4
11
-
---
5
+
This pack contains **three** nodes:
12
6
13
7
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.
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.
16
10
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.
@@ -37,84 +28,124 @@ This pack contains two nodes:
37
28
1. Navigate to your ComfyUI installation directory.
38
29
2. Go into the `ComfyUI/custom_nodes/` folder.
39
30
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.**
42
45
43
46
The nodes will be available by right-clicking the canvas and selecting **Add Node > WanVideoLooper**.
44
47
45
48
---
46
49
47
50
## 1. WanVideo Looper
48
51
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.
***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.
61
64
62
65
### Inputs & Outputs
63
66
64
67
***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.
73
76
*`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.
88
93
***Optional Inputs**
89
94
*`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.
91
97
***Outputs**
92
98
*`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.
94
100
95
101
---
96
102
97
-
## 2. WanVideo Looper Lora Sequencer
103
+
## 2. WanVideo Looper Prompts
98
104
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.
***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.
108
116
109
117
### Inputs & Outputs
110
118
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)*
115
126
* **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.
118
129
119
130
---
120
131
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.
***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.
0 commit comments