ComfyUI

VFX Breakdown: Changing Youngji’s Red Hair to Black Using AI

Do you guys remember the Youngji red hair scandal during the local elections? She dyed her hair red, people started taking it as a political signal, and she had to rush to the salon, dye it back to black, and drop an apology. But what happens to the commercial spots she already shot? She had this KFC commercial running where she was still sporting the red hair. I thought this was the perfect scenario for some practice. I wanted to see if I could use AI to retroactively change her hair to black in a 3-second shot from that commercial. It’s kinda like a narrative behind the reason I chose this specific shot to practice on, treating it like a real-world post-production rescue mission to fix a finished asset without needing a reshoot.

The 3-second shot to be worked on.

Getting the First Frame

I started by taking the shot and extracting the very first frame using AE. At first, I used Nano Banana Pro to change the hair color, but several prompts later, her face kept changing. I decided to switch over to ChatGPT Images 2.0, and it was one prompt, one kill. It gave me the perfect starting frame with black hair while perfectly preserving her actual face.

Nano Banana Pro kept giving me Rose from Blackpink and couldn’t keep the rest of the scene consistent.
ChatGPT Image 2.0 was able to produce the First Frame that I needed.

Generating the Video in Kling

With the first frame ready, I went to Kling and used the First Frame plus Reference Video method. My prompt was to change the subject’s hair color in the video to black, using my newly generated image as the first frame. I hit my first obstacle here because the reference video was too short for Kling. It was about 60 frames for a 24 fps video, but Kling needs a minimum of 72. So, I jumped back into AE and freeze-framed the front and back for a few frames to hit that 72-frame requirement. I put the extended clip back into Kling and ran it. The generation was one try, one kill.

Before and After Kling 3.0

Masking in ComfyUI

Even with a great AI generation, I didn’t want to just paste the new video over the commercial and ruin the background and all the KFC branding. I needed to isolate her. I booted up ComfyUI and used the RMBG node on the BEN2 model to extract just the mask of Youngji from the original video. Well, I could have rotoscoped her out in AE directly, but where is the fun in doing it manually when I can throw it to AI to do it quickly? Furthermore, all I needed was a rough mask, so RMBG within ComfyUI was more than enough.

Used RMBG (BEN2) to get a mask image video.

Final Comp in AE

For the final step, I brought everything back into AE. I used a luma mask to remove the dark parts of the mask and added a feather to soften it. Then, I used minimax to increase the area of the non-alpha channel so the new mask would completely cover her original red hair. Finally, I overlayed the Kling footage of black-hair Youngji over the original video, using a Track Matte of the edited mask of Youngji to get the final output.

The whole process in a nutshell

The final result seamlessly replaces the controversial red hair while keeping the original environment and lighting completely intact. It really goes to show how integrating generative AI tools into a standard workflow gives you a ton of creative control and efficiency, especially if you ever need to save a campaign from a sudden PR issue.

Continue Reading

AI-Driven Apparel: Building a Procedural Colorway & Embroidery Pipeline in ComfyUI

In the fast-paced world of e-commerce fashion, efficiency is everything. Conducting a new photoshoot for every single garment colorway and branding update is time-consuming and expensive. To solve this, I recently developed a production-ready ComfyUI workflow designed to automate product variations from a single base image.

Overview of the ComfyUI workflow

Here is a breakdown of the brief, the technical pipeline, and the challenges involved in bringing this digital wardrobe to life.

The Brief: E-Commerce Fashion Automation

The objective was straightforward but technically demanding: Take a standard studio photograph of a model wearing a blank black hoodie, and programmatically generate new product colorways (such as Sage Green, Vibrant Yellow, and Hot Pink).

Beyond just changing the color, the pipeline needed to composite a brand logo (in this case, Nike) onto the chest. The critical requirement was absolute realism, preserving the original fabric’s texture, lighting, and fold structures, while ensuring the logo looked like a physical, raised embroidered patch cast naturally onto the fabric.

The original base image featuring a standard black hoodie.

The Pipeline: Masking, Swapping, and Inpainting

To achieve this, I built a multi-stage image-to-image and inpainting workflow utilizing FLUX models within ComfyUI.

  • Targeted Masking & Color Injection: The first stage isolates the hoodie from the subject and background. Instead of relying purely on text prompts to guess the color, the workflow drives the color conditioning using exact RGB values.
  • Structural Preservation: By utilizing reference conditioning and latent noise masking, the AI is forced to map the new solid color directly over the existing structural data. This ensures that every crease, shadow, and highlight from the original photograph is perfectly retained in the new colorway.
A split view demonstrating how the flat RGB color input is processed by the model to retain all the natural fabric folds and studio lighting.
  • Logo Integration: The secondary stage handles the branding. A 2D logo mask is composited onto the targeted chest area.
  • The Embroidery Pass: Finally, targeted VAE inpainting is applied specifically to the logo’s masked region. Guided by precise positive prompts focused on macro details (“Raised stitching,” “Cast shadows,” “Neat and even color”), the AI converts the flat graphic into a photorealistic embroidered patch.

The Challenge: Nailing the Embroidery Composite

While altering the garment’s color was a relatively smooth process, the true technical hurdle of this project was compositing the logo onto the hoodie seamlessly.

The transition from a flat 2D graphic to a realistic, textured embroidered patch proved to be incredibly sensitive to backend parameters. Even a very small change in the KSampler values, such as a slight adjustment to the denoise level, step count, or altering the scheduler type, would cause the logo embroidery to break, artifact, or simply look “weird” and unnatural. Finding the exact mathematical sweet spot where the AI recognized the structure of the fabric underneath while generating the thread texture on top required extensive iterative testing.

Close-up split views showing the flat 2D mask input versus the final AI-generated raised embroidery texture.

The Business Impact: Efficiency at Scale

To truly understand the strength of this workflow, it is important to look at the tangible savings in money and man-hours.

Traditionally, producing high-quality marketing assets for four distinct colorways with updated branding requires a massive logistical lift: manufacturing physical garment samples, renting studio space, and hiring a photographer, model, and hair/makeup artist. Following the shoot, a retoucher would spend hours color-correcting and cleaning up the images. That traditional route easily consumes weeks of planning and thousands of dollars per campaign.

In contrast, developing this complete procedural pipeline took less than a single day. Once the node architecture and KSampler parameters were locked in, the marginal cost of creating a new variation dropped to zero. Generating a new, color-accurate hoodie with a photorealistic, perfectly placed embroidered logo now takes mere seconds. By front-loading the technical development, this workflow completely eliminates the need for reshoots, saving countless man-hours and drastically reducing the budget required for e-commerce catalog expansion.

The Final Output

The system is now highly stable and capable of producing endless variations with near-perfect positioning and consistency of the embroidered logo’s look across all generated batches.

This project was a great exercise in pushing generative AI beyond conceptual ideation and turning it into a precise, highly scalable, and production-ready tool for commercial asset creation.

Continue Reading