r/StableDiffusion • • 18h ago

Animation - Video Decide then Render + Long video H3

New research https://github.com/duanhuiran/Decide-then-Render that all steps aren't needed with flux and qwen and I wanted to see how it turns out with H3.

My usual workflow is 6 steps at 960x544 then upscale and 2 more steps at 1920x1088 with LMS.

What I found is that I can skip the last 2 steps of the 6 steps and just let the refiner take over from there.

Run the first 4 of the 6 low-res steps and take the clean estimate, upscale 2× with the LMS latent upscaler, then refine for 2 steps at full res. In sigma terms: base at 1 → .973 → .923 → .8 → x0, then upscale, then refine at .8583 → .5333 → 0.

The sections are chained together with a 5 frame overlap, rendered on an RTX Pro 6000 on Runpod. You do have to render these one at a time because you need the last frames.

All render times, inputs, and prompts and full 60fps are here:
https://studio.no.dev/share/nh7563dv5qshgwghs18csq38358k95kt

Also did a different song but the background vocals + lipsync aren't great.
https://studio.no.dev/share/nh740mv2vmdft28834haf4vwd58k9mzh

Thank you u/roychodraws for clown girl for examples I've learned a lot from you.

0 Upvotes

37 comments sorted by

9

u/ghosthacked 17h ago

OK, I got to ask, is this character like the official mascot or something? Why do I see this character on almost everything related to minimax/h3? 

9

u/Rehablyte 17h ago

LOL its just a good test character. Rainbow to see luma changes, enough skin to see realism, unique outfit and look to test rotation and movement and its just fun

-5

u/DoctaRoboto 16h ago

I despise that stupid clown. I hope someone makes a Hellraiser Lora so I can tear her apart over and over again.

3

u/DietAshamed2246 15h ago

Too late. Someone posted a MiniMax-H3 video yesterday in which the clown girl was shot dead in the end.

2

u/Etsu_Riot 12h ago

I hate spoilers.

1

u/roychodraws 12h ago

wasn't she stabbed? or is that another one.

4

u/Occsan 17h ago

You can try dchatel/comfyui_davcha_samplingtricks. It doesn't have any requirements. So, if you decide you don't like it afterall, you can simply remove the folder and nothing will break.

It features few nodes, at least one might interest you : DavchaScheduledSampler.

It takes a list of samplers and a list of integers (splits).

In your case, you'd plug your first sampler then LMS, and write 4 in splits. That way the first 4 steps are done with your first sampler, and the last ones with LMS.

No need for two KSamplers.

BTW, when you chain KSamplers, you actually destroy the parts of the latent, in particular, it destroys any mask in the latent (for inpainting). There's also unnecessary computation done when chaining KSamplers.

This node fixes all of these issues.

And then, there's DavchaSamplerFourierUpscale, which is similar to LCMSampler, except it upscales the latent in the fourier domain instead of the spatial domain, preserving the existing noise and adding new fresh (controllable) noise only in new higher frequencies introduced by the upscale.

1

u/Rehablyte 17h ago

Thanks, I read the source. For our H3 setup the scheduled sampler doesn't change much. The base pass is one Euler run, and the refine runs at a different size after a learned upscaler, so there's nothing for it to merge. Also, KSampler copies the latent dict and replaces only samples, so noise_mask does survive a chain. The Fourier upscaler is the interesting one, but it doesn't support denoise_mask, and we hold the audio and pinned frames with masks. I'm trying the noise-anchoring idea by itself in our refine pass.

1

u/Occsan 17h ago

Also, KSampler copies the latent dict and replaces only samples, so noise_mask does survive a chain.

Can you check this in a test aswell ? Last time I checked it wasn't preserving it.

I'm implementing DtR in the fourier upscaler node right now.

1

u/reeight 14h ago

& updated since you posted it...

2

u/Occsan 6h ago

Yep. I added Band Noise and parameter to Fourier Upscale, so it can reproduce DtR too now.

4

u/ShutUpYoureWrong_ 13h ago edited 13h ago

Sorry, I'm trying to understand, because this is potentially really fucking interesting. I have a series of questions, some of which may be non-applicable:

  1. How many attempts/rerolls for each part to get the clips seamless?
  2. Did you use any anti-degradation (e.g. Geiru Context Suite)?
  3. 5-frame overlap using what method? How are you chaining, precisely?
  4. Do you have a workflow? Yeah, I'm being that guy. I was sad when I went to your site and they weren't embedded in the videos.
  5. What is her cup size? (paging /u/roychodraws)

This is a surprising and new (to me) technique and I'm trying to understand exactly what's going on here, even though it seems fairly simple from the outside.

I also don't understand why this has zero upvotes. What the fuck, guys?

1

u/Rehablyte 13h ago
  1. I redid the whole thing one because the original song I picked wasn't a good choice (where's my husband - linked at the bottom of the post)
  2. I use color matching on the output video to the starting frame.
  3. I take the last 5 frames of the previous video and those become the first 5 frames of the next video. then when combining the video everything except the last video gets 5 frames cut off before joining them together.
  4. I don't have a workflow because this isn't comfyui - its just code that interacts with the model directly.

1

u/roychodraws 12h ago edited 12h ago

my hybrid windows functions in a way where i save the steps at 6 and onward as latents and then hold onto them "in case" i want to do blend passes. so i'm very familiar with saving latents mid steps and using them later in other ways.

The way I'm understanding this it seems as if you're doing a simlar thing just before the last 2 steps you upscale essentially taking an upscale from 8 steps and 2 upscale steps with denoising to a 8 total step process.

though i'm guessing because you used an rtx 6000 you're not tiling, which would likely mean that it works but it would be limited for someone without access to a large gpu to use, correct?

1

u/Rehablyte 12h ago

I don't save any latents because I might not always be rendering on the same machine. the way I have runpod and studio setup is that I can round robin jobs between multiple machines so I'm just saving end frames.

correct I'm doing 6 + 2 (well now 4 + 2 since that seems to work just as nicely).

for tiling I mostly ported over `MiniMaxH3VideoVAE` node

claude: `The VAE decode is tiled. It decodes 256 px tiles with at least 64 px of overlap, and runs time in chunks of 5 latent frames, so its memory use stays bounded at any resolution. The diffusion passes aren't tiled. In our tests on a 32 GB budget, the base pass used 24-30 GB, and the 1088x1920 refine and decode peaked at 34-37 GB. So it doesn't fit on a 5090 yet, and lower-res or shorter clips are the way in for now. We haven't run it on a real 5090.`

1

u/roychodraws 12h ago

also what you're doing is pretty similar to this.

https://github.com/StanLukuvka/ComfyUI-SPEED-Sampler

might check it out.

1

u/Rehablyte 12h ago

Oh yea the original speed paper is what started all this LOL

1

u/Rehablyte 12h ago

I just went crazy and ported it over to MLX for Z-Image-Turbo then started doing it on other models then MLX got a CUDA backend so I could do it on runpod

1

u/roychodraws 12h ago edited 12h ago

not tiling the decode, tiling the sampling. consider using the decode to disk vae or a code equivalent in here so you don't have to tile at all.

https://github.com/NikoDemon80/ComfyUI-H3-Motion-Context

Yeah, this is interesting but i would love it much more if it fit on a card that cost less than 12,000 dollars lol

i can't imagine tiling the sampling would work with this and i don't see how the average person could make use of it yet without tiling. it's super cool tho.

1

u/Rehablyte 13h ago

also to 4. I don't mean to be difficult - I know this subreddit and most people doing AI video use comfyui but I used to use it for the site but every update required so much testing to make sure nothing broke and I'm a solo dev with a full time job so I don't have a lot of time to test. So I (and by that I mean claude) rewrote it all away from comfyui and PyTorch so I can be sure nothing breaks in older code (like this started out as a rewrite for Z-Image-Turbo images). I still use a lot of the same techniques as comfyui which is why I wanted to share some of research I'm doing - like the DtR repo I found today.

1

u/Rehablyte 12h ago

Each section takes over the previous section's last 5 frames (2 latent tokens). We pin those tokens with a noise mask on both the base and refine passes, so the model can't redraw or relight them. Before this, H3 used them only as a guide, redrew them, and changed the exposure by the second frame, which left a step at the seam of up to +11.7 luma. With the pin it's about -1.5.

Some chains still flash on the second frame after the held five, and we haven't found why. When building the reel, the stitch checks that frame after each join. If its mean luma is more than 1 above both neighbours, it histogram-matches the frame to them per channel. A low-frequency weight map applies the grade in proportion to how much each part of the frame flashed. One flash was +5 luma at the top of the frame and +30 on the road, so an even grade left it visible. This only fixes the reel. The section files keep the flash.

1

u/roychodraws 11h ago edited 11h ago

why just 5 frames?

you can mask as many frames as you want. it doesn't add extra tokens. it's 2 latent "frames" not tokens, (it's 1000s of tokens) but it's the same amount of frames and tokens whether they're masked or unmasked.

1

u/Rehablyte 11h ago

I just chose the minimum needed to get continuous motion. I mostly started making talking head videos and longer than that and I had to plan around the sentence structure lol

1

u/roychodraws 11h ago

i would switch to 22 and see if the flashing stops

16

u/ThreeKiloZero 17h ago

sick physics

1

u/MastMaithun 16h ago

Few questions:

  1. are you saying -
    - doing this is gets you better quality
    new way=>> 4 out of 6 steps used for gen at 0.5mp -> latent upscale to 2mp -> run remaining 2 steps of base's here as refiner on 2mp
    compared to old way =>> 6 steps used to gen at 0.5mp -> latent upscale to 2mp -> 2 individual steps (maybe at lower denoise say 0.3) as refiner on 2mp
  2. do you mean doing that solves chaining issue, means degradation?

2

u/Rehablyte 16h ago

I don’t get better quality skipping the last 2. As far as I can tell and measured it’s the same quality and lets me skip 2 steps.

This is unrelated to chaining. I just used a chain as an example. Anything to speed up the sections makes the chains easier.

3

u/UnderstandingTop9261 15h ago

Could I get the workflow file?

1

u/Aaron_rowe81 16h ago

skipping steps works nice!

1

u/More-Ad5919 10h ago

Thats the voice of Ren.