Skip to content

Support for 5D latents (video models) and scheduling#62

Open
blepping wants to merge 1 commit into
shiimizu:mainfrom
blepping:feat_5d_latent_and_scheduling
Open

Support for 5D latents (video models) and scheduling#62
blepping wants to merge 1 commit into
shiimizu:mainfrom
blepping:feat_5d_latent_and_scheduling

Conversation

@blepping

@blepping blepping commented Mar 8, 2025

Copy link
Copy Markdown

The main thing this pull adds is support for 5D latents so Tiled Diffusion can be used with video models and the ability to schedule the Tiled Diffusion effect.

Some refactoring was necessary to make applying settings function in a relatively sane way. Some of it, I just couldn't help myself. :) I tried to preserve the existing code style as much as possible.

One change I probably should explain is instead of having to track existing TiledDiffusion instances with a WeakSet, one can just keep a sequence number and update it whenever the instances need to reset. That way, instances can just save the sequence number from the last reset (or when they're created) and know to reset themselves when it changes.

These changes are lightly tested, as far as I can tell they don't break existing functionality. There is one case where they would break existing workflows: when a user is applying SpotDiffusion parameters before the TiledDiffusion model patch is applied. These changes require applying parameters after TiledDiffusion.

This pull also adds a TiledDiffusion Advanced Parameters node that currently allows configuring the start/end sigmas for the Tiled Diffusion effect. Adding other options, like allowing the user to specify a list of bboxes would be possible in the future. It would be pretty nice to be able to use custom bboxes instead of a fixed-size grid.

I'd like to add the ability to do temporal tiling but I figured I would make that a separate pull to keep these changes relatively manageable.

Small example of what this can enable:

AnimateDiff_00161.mp4

@shinonomeiro

shinonomeiro commented Aug 4, 2025

Copy link
Copy Markdown

What's the status for this PR? It's been pending for months now, and @shiimizu seems to have given it a thumbs up.
Wan 2.1 (and other video models it seems) sadly fails with the error below (thrown by the ksampler) when trying to hook in TiledDiffusion, and I assume this PR is a fix for that?

too many values to unpack (expected 4)

Edit:

I've checked out this branch locally, everything seems in order. 👌
Thanks a lot for your hard work on this! Hopefully this is getting merged soon so us plebs can get this update from ComfyUI Manager. I have no clue about the code which is far beyond my abilities, so I'll leave that to @shiimizu. 😄

@blepping

blepping commented Aug 4, 2025

Copy link
Copy Markdown
Author

Thanks a lot for your hard work on this! Hopefully this is getting merged soon so us plebs can get this update from ComfyUI Manager.

No problem, glad it ended up being helpful for you. I'd actually planned to give up and just close this but I forgot about it. Kind of doubt if there hasn't been any response after this much time that it's ever going to get merged.

@shinonomeiro

Copy link
Copy Markdown

I'd actually planned to give up and just close this but I forgot about it.

Please don't. I find it surprising that this custom node sees so little support in spite of its powerful capabilities and speed (relative to Ultimate SD Upscale which is extremely slow and clunky). This has been my go-to node for large resolution upscaling.

@shinonomeiro

Copy link
Copy Markdown

I've run a number of inferences with this update on a Wan 2.2 t2i workflow, and the difference in quality is absolutely striking.
Thanks so much again, and please try to support this repository as much as your time allows. 🙏
Qwen-image just dropped today, so perhaps this might need yet another update, but that isn't a video model so I guess it should be fine?

@shiimizu

shiimizu commented Aug 5, 2025

Copy link
Copy Markdown
Owner

Hi, thanks for taking interest in this PR, and thank you to @blepping for your work. Sorry for the late response. I do plan on merging it. It's just that there are other changes within, such as the TiledDiffusion Params that I haven't gotten around to fully testing, which I'd also like to have a more suitable API that resembles ComfyUI's other core nodes. If you want this merged quickly, please move that change to another PR or omit it from this one for the time being.

@blepping

blepping commented Aug 9, 2025

Copy link
Copy Markdown
Author

If you want this merged quickly, please move that change to another PR or omit it from this one for the time being.

@shiimizu Do you just mean remove the advanced parameters node?

Allow scheduling the Tiled Diffusion effect
Other minor cleanups
@blepping
blepping force-pushed the feat_5d_latent_and_scheduling branch from 1169db0 to 265d5a4 Compare September 6, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants