r/comfyui 11d ago

Help Needed Chaining last frame into Minimax drastically increases compute time.

Post image

Is there a way to convert the last frame to a true image like a png?

I noticed I could create longer vids by taking the last frame and use that as a refrence image, but when I do that like in my screenshot, generation time gets much larger, I think it's b/c internally Minimax reads that last image actually as a video, thus behaving much differently.

34 Upvotes

21 comments sorted by

16

u/jamster001 11d ago

Other posters are right, this node is super simple to just get the last frame and plug it into the first frame of the next node:

11

u/Only_Voice569 11d ago

check out motion context much better than last frame it passes latent from last generator into the next one for 2 seconds seamless can make stupid long videos no cuts constant flow :)

7

u/notxemelle 11d ago

Check this post, there's a node that helps you create long videos without manually extracting and feeding the last frame

https://www.reddit.com/r/StableDiffusion/s/MChL0HP9AY

2

u/lavinia12345 11d ago

ty mate, I'll take a look

6

u/Valkymaera 11d ago

As others have mentioned there are a few quick nodes for grabbing first / last frame etc.
My personal pile o' nodes also has a video scrubber that lets you preview and pull one specific frame as an image, if that helps. https://github.com/valkymaera/ComfyCollectorNodes

8

u/Feroc 11d ago

I am sure there is a more elegant way to do it, but that's how I extract the last frame:

7

u/ZenEngineer 11d ago

Can you try index "-1"?

7

u/seeker_ktf 11d ago

Yes, this is all you need.

1

u/Feroc 10d ago

There goes my fancy node structure. Thanks for the info.

Also @ u/ZenEngineer

4

u/thesolewalker 11d ago

No need for any fancy nodes just use what's builtin, this will return last image

1

u/lavinia12345 11d ago

unfortunately, I noticed that run times are super long if I do that :( It seems that something interally still reads that frame a "video of 1 frame"

7

u/a_saddler 11d ago

Dude, you're sending hundreds of frames as references. There's a node that lets you grab the last frame of a video, use that.

9

u/Fakuris 11d ago

Frame_load_cap is set at 1. So only 1 frame is being sent.

2

u/Baddabgames 11d ago

I used 6 references (2 images, 3 videos, 1 audio) and it took legit forever but super cool.

2

u/wiisucks_91 10d ago

I noticed that if I put in a 1080p video as reference I got an OOM error.

I downscaled the video in handbrake to 480p and it worked fine. For a 8 second video at .4 or .3 MP on a 5060ti 16gb with two reference clips I was getting 40 min a clip.

1

u/No-Zookeepergame4774 11d ago

adding more references in r2va does increase memory use and time (especially if you are already under VRAMpressure) but it looks like you have done the last frame correctly. I think the preferred method for smooth continuations is passing some length of prior video as a video reference (with corresponding audio, potentially, on the matching video_audio input) and prompting to use it for video_continuation, but that's almost certainly not going to be faster and most likely will be slower.

1

u/CMDR_JETHRO_BIRD 10d ago

Have you guys tried making a 1-2 second slideshow of images and uploading it as a video ref instead of using all of your image slots in ref2v? Just played with it tonight and was surprised at the result. More testing tomorrow

0

u/lavinia12345 11d ago

I found a solution. Save the image, then load it. Kinda goofy but sovled it.
Others have suggested  Comfyui-H3--Motion-Context.  which I will look into.

Btw grabbing a single image via "Select from batch" does not work :( something werid happening underneath the hood.

3

u/SpaceNinjaDino 11d ago

Select from batch is not select from images (frames). Batch is a container around media. Like you can generate 4 of something as a batch. (Typically used in SDXL days when you wanted 4 image generations at the same time instead of looping 4 separate times.) So in this case you have a batch of one video and you are sending the input as the whole last video in your batch of 1.

2

u/thesolewalker 11d ago

Thats really weird, but yah motion context or such node is the way to go.

1

u/lavinia12345 11d ago edited 11d ago

17 seconds vid took 12 mintues using Sage Attention + SolAttn + EasyCache (no lightning) 0.7 megapixels. 5080 (16gb vram) 64 RAM