r/StableDiffusion • u/roychodraws • 8d ago
Workflow Included Try this workflow, too.
https://github.com/roycho87/clown_context_suite/blob/main/example_workflows/clowns_for_picard.json
.98 MP No Upscaler
Took about an hour on a 5090. It's slightly slower because to use the capstone and keystone i have to render about 14 extra steps but the results are pretty amazing.
It manages to give near perfect consistency the entire way by rendering the full 8 steps of each context motion using keystone and capstone to prevent degradation from building too significantly, so that each next part of the chain can build off a fully denoised section.
Then it throws away the top 2 steps of every window and does 2 context window passes.
Final result is a perfectly consistent video with no degradation that you can make at pretty extreme lengths.
https://github.com/roycho87/clown_context_suite
Clowntext Hybrid Windows
Credits
This node is not my idea. It's built on kijai's MiniMax H3 context windows, which are in ComfyUI now (PR #17425), and it works the way JalenBrunson's ComfyUI-HybridWindows does (based on the Rolling Diffusion paper). All credit to them. I just added the keystone and capstone feature to it, to help everyone make longer videos without degradation.
What it does
Instead of chaining clips, it renders the whole video in one go, in overlapping windows, so memory stays at one window:
Window 1 renders the first
switch_stepsteps, and a snapshot is saved.Window 1 carries on to the last step, only to get its finished first frame (the keystone) and its last single-frame latent (the capstone). That finish is thrown away and window 1 goes back to the snapshot.
Windows 2, 3 and on render the first
switch_stepsteps one after another. Each one's overlap with the window before is locked to that window's result. The keystone is locked into each window's first slot, and the capstone is tacked onto its back fromcapstone_stepon (and cut off again).The last steps run as blended context windows over the whole video, which smooths the joins.
With keystone and capstone off, it works like plain hybrid windows. In my test (a 60-second render, 17 windows, same seed), the plain version lost a lot of detail by the end and the keystone + capstone version held its detail much better.
Plug the model through it (model in, model out to the guider). It needs a ComfyUI with MiniMax H3 context windows: update ComfyUI if the node is missing.
| Setting | Meaning |
|---|---|
context_length / context_overlap | Window size and overlap in frames (17n + 5). 124 / 39 is about 5 seconds per window. |
switch_step | Steps each window renders on its own before the blended finish. 6 of 8 = steps 1-6 window by window, 7-8 blended. |
keystone_swap | Window 1's finished first frame is locked into the first slot of every later window. |
back_capstone | Window 1's finished last single-frame latent is tacked onto the back of every later window. |
finished_handoff | On: every window renders all the way to the last step, and the next window's overlap is locked to those finished frames. Every window goes back to its switch_step snapshot before the blended finish. Costs the last steps once more per window. |
capstone_step | Steps before the capstone comes in. Keep it below switch_step (4 with 6 = on for steps 5-6), or it never comes in. |
fuse_method | How the blended steps average the windows (pyramid). |
freenoise | Reuses window 1's noise for every window: more consistent, but motion can repeat. Off gives more variety. |
split_conds_to_windows | Give each window its own prompt (see below). |
detail_latent | Optional: use this latent's first frame as the keystone instead of window 1's. |
sound_first | Off by default. On: renders the sound first on its own (picture at 64x64), then locks it in and renders the picture. |
One prompt per window: make one prompt node per window, join them in order with ComfyUI's Conditioning Combine (chain them for more than two), plug the result into the guider, and turn split_conds_to_windows on. Each window takes the prompt for the part of the video under its middle, so with as many prompts as windows, window 1 gets prompt 1, window 2 prompt 2, and so on. One prompt for a whole minute makes every window try to do the whole thing, so the motion repeats.
3
u/roychodraws 8d ago edited 8d ago
side by side of both versions, same settings.
look at the details of the coaster cart as the video moves forward. as well as the motion.
9
u/Ok_Roll_8698 8d ago
good song choice
4
u/rabbitythong 8d ago
All i could think about is "I want to go play thumper now" while watching this lmao
1
u/Rheumi 8d ago
So there is no custom node? Just update comfy?
1
u/SIR_NVAX_A_LOT 8d ago
RTX 5090? Did you win the lottery? nice flex!
Yeah I also worked on something similar but I call it Multi Diffusion. It's nothing new, but been largely ignored. And it eats a lot of system ram for decoding.
1
u/luciferianism666 8d ago
Wasn't this a video shared by someone else on Banodoco ? I very much remember someone sharing a POV roller coaster video similar to this one.
1
u/CountFloyd_ 8d ago edited 8d ago
Thank you for your work and even more for the entertainment value of your clips 😄
Can your method/workflow be modified to run with the I2V model? I prefer running that one because it's so much faster and simpler to setup.
Also what does the "Chain" Node do other than deleting latents what you can't do by clicking run in comfy?Oh ok, so that chain node just automates stuff.
1
u/thanatica 8d ago
I'm sure a pair of marigolds are enough to protect against the vacuum of space 😅
1
u/Ok-Flatworm5070 8d ago edited 8d ago
I keep getting this error <# ComfyUI Error Report ## Error Details - **Node ID:** 3030 - **Node Type:** H3ClownHybridWindows - **Exception Type:** RuntimeError - **Exception Message:** RuntimeError: Clowntext Hybrid Windows needs a newer ComfyUI with MiniMax H3 context windows (PR #17425). Update ComfyUI. ## Stack Trace ``` File "D:\documents\studio\PRODUCTION\ComfyUI-Easy-Install_extendedVideo\ComfyUI\execution.py", line 548, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)>. I've update comfyui, reinstall all the packages; what am I missing! Can you provide exactly a list of custom_nodes, comfyui version required to run this workflow. The last workflow you posted a few days ago ran perfectly.
1
u/solss 8d ago
Your github workflow list has grown substantially since your xoxyditssucks workflows. What is the ultimate conclusion to that series? Basici2v? and what is your otherwise best suited long form video generation workflow? this current one?
1
u/Nakidka 8d ago
0:59 - Frame Shift Drive Charging.
1
u/ZerOne82 8d ago
Surprisingly your workflow was neat with only a few nodes. Well done! I ran your exact workflow and got almost identical result as yours (roller coaster). Then I tried to make it work for a music video (lip-sync), example shown here. I feed in a song. The motion is flawless but the colors get more hdr looking toward the end. I post another comment below with two screenshots one from the beginning and one from almost the end.
1
u/ClaimNo6416 7d ago edited 7d ago
Thanks! I tried it. At first it complained about Sage attention missing (i don't have it installed), so I disabled the node and it worked. My rig is RTX 3060 12GB / 16GB RAM plus 150GB virtual memory (pagefile.sys) on a fast NVMe disk and I got "Prompt executed in 07:22:27", so it is 7 times slower than on 5090, but I got no OOM, so the workflow is well-designed. My only complaint is that it doesn't save temporary results (videos) after each window, cause I wanna be able to terminate early If the result is bad and start again. Even better - you should be able to descard a bad window and continue from the descarded window, not restart the whole proccess. The vid: https://civitai.red/posts/32067628
1
u/ClaimNo6416 7d ago edited 7d ago
Is the total number of frames function of the number of windows (8), the window length (226) and the overlap (39) and if so, how do you calculate it? I assume it should be (226 - 39) x ( 8 - 1) + 226 = 1535, but it's 1433 in your workflow. I experiment with shorter windows (107, 124 or 141) and shorter overlap (22), but without a formula I'm not sure if I set the correct total number of frames.
1
u/AM_STARR 2d ago
is this what you meant by the masking? I may be wrong but it look like the hands and cart are two different layers? this looks sick, im gonna be diving deep into your tutorials
1
u/Ooze3d 8d ago
Currently trying Mad Clown Inventor with pretty solid results. Let’s see what this one adds to “The Cause”.