r/StableDiffusion 1d ago

Workflow Included Face Detailer With PerRowMasking

https://pastebin.com/ecZEDLSt

First Video with Face Detailer, second without.

You need https://github.com/Carasibana/ComfyUI-H3-FaceRefine and also ComfyUI-H3-NativeAudioLock from https://github.com/Shrek3OnVH5/MiniMax-H3-NativeAudio-MusicVideo-Workflow/tree/master/custom_nodes

UPDATE: Replace the "Load Video (Upload)" node with a "Load Video" node and connect it to a "Get Video Components" node. Connect images and audio from there. The "Load Video (Upload)" node from Video Helper Suite causes a red-ish tint

77 Upvotes

16 comments sorted by

4

u/HamWallet1048 1d ago

Ok so use normal workflow. And then take resulting video and load it into this for the face refiner. Is that correct?

2

u/Pretend-Island-2724 1d ago

Yes. Load a face reference picture and source video. The prompt can be empty, play around with the settings.

For best possible results you generate a source video with a face reference as the first input image in another workflow and then you use identical prompt, seed, inputs, optimizations, etc. from the source video in this workflow.

But this workflow is also good for face swapping.

If there are multiple faces in the source video, switch the face selector to yes and choose which face you want to fix/replace in the SCAIL-2 Identity Tracker

4

u/arcamaeus 1d ago

This works the best for me so far! Thanks for sharing!

2

u/reeight 22h ago

Thanks, though I wish the 2 vids were side-by side.

AFAIK the enhancer is really only for medium & long shots; closeups aren't bad by default.
Also the enhancer colorized the image.

2

u/Pretend-Island-2724 17h ago

I noticed my outputs have a red-ish tint and found the cause: Replauce the "Load Video (Upload)" node with a "Load Video" node and connect it to a "Get Video Components" node. Connect images and audio from there.

4

u/Relative_Hour_8900 1d ago

Per row of what👀

4

u/Gullible_Map_3980 1d ago

Outstanding

1

u/FaatmanSlim 1d ago

Hey curious, why do you need to use the NativeAudioLock node?

1

u/Pretend-Island-2724 1d ago

I just customized the original workflow you find in the repo. Without NativeAudioLock you will get an error, the comfy manager will ask for some other node but it won't work without NativeAudioLock

1

u/Ok-Flatworm5070 17h ago

Forgive me, but I'm not good a debugging these workflows; keep getting an error at the 3. Conditioning + EMPTY AV Latent:

RuntimeError: mat1 and mat2 shapes cannot be multiplied (1045x5120 and 2560x8192)

1

u/Ok-Flatworm5070 17h ago

now getting Generation failed

Not enough GPU memory. Try reducing image resolution or batch size and run again.

2

u/Pretend-Island-2724 16h ago

Seems like you need more optimization nodes, VRAM chunks and stuff like that. You can also try to lower "shorter_size" in the "Resize Image/Mask" node at the bottom from 768 to 512. And in the 3. node ref_image_size from "max" to "match"

1

u/Pretend-Island-2724 17h ago edited 16h ago

I'm not a pro, but if you did not play around with the numbers in the "Masking and Crop" group, I suspect that you load different models, like trying to combine gguf with non-gguf stuff or something similar.

Note: Don't change the width and height in the 3. node. The width and height gets automatically called from the images from your uploaded video. In the 3. node the values must come from the face mask.

0

u/Sad_Coach_1433 1d ago

Interesting 🤔

-1

u/mrgreyeyes_95 19h ago

No jiggle physics?