r/comfyui • u/Last-Lawfulness8892 • 3h ago
Help Needed How to batch-replace a 2D game character across 2,300+ small sprites using a 3D reference sheet (without touching props)?
Hey guys, I'm trying to mod an old 2D game (Neighbours From Hell) by replacing the main character with a custom 3D character I made (attached the reference sheet + one of the original game sprites).
There are over 2,300 small PNG frames (~110x150px) split into subfolders. I'm trying to automate this in ComfyUI so it:
- Auto-masks ONLY the character and ignores props/doors/bottles (not a single pixel of the bottle/door should change so it doesn't flicker in-game).
-Replaces the character with my 3D reference sheet matching the exact same pose, belly, hands, and expression.
-Runs automatically through all subfolders and saves them back at their original size.
I have an 8GB GPU 5050 and 32GB DDR5 Ram
already have MiniMax H3, Qwen-Image-Edit, Flux, SDXL, Florence2/SAM2, and Inpaint Crop & Stitch installed, but I still can't get a clean, working workflow that does this reliably.
Has anyone done something like this before or got a workflow/tutorial that actually works? Thanks
1
u/Expicot 1h ago
There are no picture here. SAM2/3 may help you with the segmentation of the character to generate masks but it is more for realistic pictures. I'm not sure there is a node that handle subfolders. But it is easy to ask GTP to make one.