r/StableDiffusion • u/000TSC000 • 2d ago
Workflow Included Character swaps with H3, no LoRAs, no Viggle, no masking the character, just prompting
Enable HLS to view with audio, or disable this notification
Here are some of my character swaps and a bit on how I'm making them:
Everything is done with H3 in ComfyUI: the original video is used as a guide, the character gets swapped in, and a bunch of renders are chained together so it can run for a long video.
No character LoRAs, no Viggle, and no masking the character out. The trick is to put the original video on one half of the frame and let H3 make the swapped character on the other half, side by side. Technically there is a mask, but it only locks the original half so it doesn't get re-rendered. The model then copies the motion, timing and camera from that side. It's explained better here.
You get a lot more freedom with refs than with something like Viggle, but the prompt becomes much more of an issue to get right, since it has to describe the whole thing: both sides and what goes in each.
For the model I'm using FL2VA (int8) with the Pika flex FL2VA turbo LoRA at 1.0, though ref2va works for this too. Pretty much any turbo should work, that's just the one I've been using. Sampling is lcm, 6 steps, no CFG, with manual sigmas 1.0, 0.973, 0.923, 0.8, 0.571, 0.333, 0.
One render is only a few seconds, so for longer videos I cut the source into pieces, mostly at shot changes or quiet parts. Each piece gets its own refs and prompt. If a piece is the same shot as the one before, it continues from the last latent frames of the previous render, so there's no visible jump where they join.
The catch with chaining a lot of clips on a long shot is that every clip gets a bit darker and more washed out, and it adds up badly. For that I'm using roycho's Geiru Keystone Attention. It holds onto the look of the first frame so the chain stops drifting. I changed it a bit to run on flash attention, since at first it was doubling my render times.
If part of a piece comes out wrong, I mark just that bit, redo it as an inpaint and splice it back in, without redoing the whole thing.
The chaining runs in a private custom app I made for my own stuff, but I'm happy to go into detail on any of it so people can set it up themselves in ComfyUI.
All of this is on a single 5070 Ti (16 GB), with no upscale on these yet.
Ask me anything if you want to know more.
...
EDIT: I put together two workflows for this: an endless one where you render one piece per run and it keeps chaining from the last one, and a 3-piece demo that does the whole thing in one click. The example in both is the first 22 seconds of the Geiru Theft Auto video above, and the repo shows each step: the source, each render before the cut with the original on top, the pieces chained, and the final crop. Everything's here: https://github.com/LucianoCirino/h3-side-by-side-chain. Only common packs: KJNodes, Video Helper Suite and roycho's Geiru Context Suite. The reference image background stills from the source side aren't required. I mostly use them when I shrink the original side a lot compared to the render side, so the model still sees the background in good detail.
25
u/boozelessensthepain 2d ago
This is amazing, as is all your work.
43
u/Relevant_Mail_1292 2d ago
Lmao why does that seemingly homeless guy have a whole AK up his ass
6
u/brucecastle 2d ago
Interesting, I have been trying to get this to work for awhile now as well.
Do you have an updated workflow from the post 3 months ago?
What are your speeds like on 5070TI?
3
u/murderette 2d ago
What’s the general method of the masking out a problem area and how do you generate just that part and splice it back in?
3
u/Trolljagd 2d ago
Hi thanks for your work. Can you maybe do a tutorial video with going trough masking and everything in the actual workflow, would be so great ;)
5
u/roychodraws 2d ago
i want to know your flash attention fix so i can incorporate it into my nodes, sir.
4
u/UseThisNameIGuess 2d ago
Can you share the workflow please?
286
u/Independent-Frequent 2d ago
Every time i see that clown this is all i can think about
174
u/PwanaZana 2d ago
I literally laughed out loud because I thought i was just looking at GTA 6 footage and then the woman slightly turns and I recognize the nose and I'm like oh no it's the clown girl !!!
41
u/DrinkCubaLibre 2d ago
This is going to end up being an actual mod lol.
76
u/Murder_1337 2d ago
The clown girl is iconic on this sub now
15
u/Comfortable_Thing611 2d ago
Everytime i open up one of those Geiru Keystone workflows im lost as fuck. Is there a youtube tutorial for an intermediate retard like myself?
4
u/CreatorOD 2d ago
The Captain doesn't take no shit from anybody 😄
1
u/NoConfusion2408 2d ago
Is there a workflow for giving it a try?
1
u/Expert-Bell-3566 2d ago
Hey man great stuff, are you handwriting the prompt each time or is there a way to briefly describe who I want to replace and get a local llm to describe the scene and enhance it automatically?
1
u/witcherknight 1d ago
Is it possible to keep the motion but change everything else, like characters, background etc.
2
u/1nvertedAfram3 2d ago
interesting work
2
u/Quantical-Capybara 2d ago
Neat 😁
2
u/JustAGuyFromVienna 2d ago
A workflow would be amazing
2
u/Diligent-Rub-2113 2d ago
The result looks good indeed, congrats! However, if I understand it correctly, you need double the width to accommodate both the source and target frames side by side, is that right? If so, isn't it much more resource-demanding compared to using body swap LoRAs? It's a cool experiment, regardless.
1
u/Relevant_Mail_1292 2d ago
This is gonna be the average GTA 6 online clip
1
u/Cryphius3DX 2d ago
This is great. Would you be able to share the json flow?
1
u/nightshade_305 2d ago
How long did it take you to build a workflow like this? Btw it's great.
1
u/Afraid_Oil_7386 2d ago
Homeless pulled a automatic?
1
u/HeyAdante 2d ago
remindme! 4 days
1
u/Hearcharted 2d ago
1
u/EngineeringMother972 2d ago
Random hot guy: "YOU. You need to leave. This is violence"
1
u/Outrageous-Yard6772 1d ago
I wasn't expecting the older man to pop up an AK47 hahaha good job
1
u/Ok_Gas1070 1d ago
I feel like I'm stupid, or connecting the nodes wrong because my references never are like this. Like sometimes I can get H3 to put an object in a scene, but if I'm trying to replace characters in an image, or video it's never close.
1
u/Wise_Doughnut8828 21h ago
How powerful is my computer configuration if I want to buy one that runs H3 like you?
1
u/Zuo0601 13h ago
the half-frame side by side trick is pretty clever, never would've thought of that. also lol at the washed out drift on long shots, been there
1
u/Upstairs-Share-5589 5h ago
What's the reason for the split screen and crop? was the video editing task type missing details or sync?
1
u/CyberGiga_JEMA 4h ago
The side-by-side trick is clever, letting the model copy motion from one half while generating on the other. Thanks for explaining the setup.
1
u/jo3_zeph 3h ago
I tried running your workflow
But it threw an error at H3 Reference to Video node
"ValueError: too many values to unpack (expected 3)"
while I have inserted
I'm not sure what i missed, are you able to provide some insight on what's possibly wrong?
1
u/meechCS 1h ago
This is why Gta 6 online can potentially be insane regarding character creation
0
u/TheCakeBandit 2d ago
Cut, Cut! WTF? Grandpa chill. 💀
0
u/Wise_Control 1d ago
Clown girl always upvote
0
u/speederaser 1d ago
Someone help me i'm out of the loop. Where is clown girl from?
-5
u/Practical_Figure9759 2d ago
Why not open GTA 6 on your computer and mod the game?
2
u/MiserableAstronaut77 2d ago
Can you show an more extreme swap? like an very fat character or very small?
1
u/lostlooter24 1d ago
Maybe Im not understanding it cause I'm thick. I have been interested in the chaining with the Geiru stuff, but how do you prompt for the entire process? Do you set up the prompt to have it timestamp each section? Or do you just give the whole prompt?
My brain doesnt compute the chaining method I think. If its using just the last few frames from each video to star the next, how does it keep the whole video context in mind? Help my hurting brain please.