Unleash Realistic Product Placements with AI-Powered Star Migration

CN
ComfyUI.org
2025-04-15 15:01:04

1. Workflow Overview

m9imql0ngy0czwcos6p153b884bf313217ddd84238863df3215167c8a1d69d78a50f2491a47a0f411a3.png

This workflow, named "Star Migration", intelligently maps products (e.g., clothing, accessories) onto models while preserving poses and backgrounds. It combines:

  • Stable Diffusion: Realistic generation (majicMIX realistic_v7).

  • Florence-2: Visual understanding of product images.

  • SAM2: Precise segmentation of products/models.

  • ControlNet & FluxGuidance: Controls structural details.

Key Features:

  • Auto-align products to models (wearing/holding).

  • Background removal via BiRefNetUltra/SAM2.

  • Optional upscaling (UltimateSDUpscale).


2. Key Components

Nodes:

  1. Input & Preprocessing:

    • LoadImage: Load product/model images.

    • ImageResize+: Standardize resolution (e.g., 1600x1600).

  2. Visual Understanding:

    • Florence2Run: Analyzes product images.

    • Sam2Segmentation: Segments product regions.

  3. Generation & Inpainting:

    • KSampler: Uses Euler (Steps=20, CFG=8).

    • InpaintStitch: Blends products onto models.

  4. Output:

    • UltimateSDUpscale: 2x upscaling (optional).

    • SaveImage: Saves final results.

Dependencies:

  • Download Florence-2-large and SAM2 models manually.

  • Install plugins via ComfyUI Manager:

    • ComfyUI-Florence2, ComfyUI-Inpaint-CropAndStitch.


3. Workflow Structure

Groups:

  1. Product-to-Model Mapping:

    • Input: Product image, model photo, prompts (e.g., "best,4K").

  2. Segmentation:

    • Uses SAM2/BiRefNetUltra for masking.

  3. Upscaling (Optional):

    • Enabled via UltimateSDUpscale.


4. Inputs & Outputs

Inputs:

  • Required:

    • Product image (transparent background or masked).

    • Model photo (with/without background).

  • Optional: Seed, resolution, sampler settings.

Output:

  • Final image (PNG) with product naturally fitted.


5. Notes

  1. Issues:

    • GPU OOM: Reduce resolution or disable upscaling.

    • Model errors: Verify Florence-2/SAM2 paths.

  2. Optimization:

    • Use FP16 for Florence-2/SAM2 if GPU supports.

    • Increase KSampler steps (30+) for complex products.