r/StableDiffusion • u/Anitabcfan • 3h ago
Comparison Fixed FaceRefine when upscaling with regenerate
Enable HLS to view with audio, or disable this notification
TL;DR: Keep the upscaled refined face and paste it on the upscaled video instead of upscaling the refined face.
- Left (
resampled refine + 1x scale): face refine stitched back into 1x frames (ComfyUI-H3-FaceRefine) - Middle (
resampled refine + 2x regenerate): those 1x frames run through 2x regenerate - Right (
refine latent + 2x regenerate): 2x regenerate with the refined face crop pasted onto the 2x output - Middle and right are 1:1 crops of the 2x output
Why
- Face refine crops the face onto a 768x768 canvas and runs H3 there, so small and medium faces are already rendered at or above 2x resolution
- Normally that crop gets downscaled back into the 1x frame and thrown away
- Running 2x regenerate on the 1x video upscales the rest of the scene, but redraws the downscaled face with artifacts and broken lip sync
Method
- Track the face, crop to 3x face height on a 768x768 canvas, and run H3 img2img at denoise 0.35 with a character reference image, repainting only the mask
- Repaint strength ramps from 1.0 at 30 px face height or less down to 0.6 at 120 px or more
- Save the decoded 768x768 crop frames as lossless PNG before color matching, along with each frame's crop rect and feathered mask in crop space
- Color-match and stitch into the 1x frames, encode to an H3 latent, and run 2x regenerate in 124-frame overlapping windows
- Paste in each window after decode, before window blending:
- Scale the crop rects to the 2x output size
- Color-match each saved crop to the regenerated frame inside the mask
- Warp the crop and mask back with the inverse affine transform and alpha-blend
10
Upvotes
1
u/lavinia12345 17m ago
facerefiner sucks. dont waste your time on it.
1
u/Limp-Firefighter1054 10m ago
Make comparison with 1080p upscaling step.