Transform Your Product Images: Advanced Style Transfer and Composition Techniques

CN
ComfyUI.org
2025-04-03 10:41:15

1. Workflow Overview

m9185alebboyofb9d941e888438e4d3a19613d38bc85e03f9d63fb029d7b582b6fe83b5293a8d56ea85.jpg

This workflow is designed for e-commerce product image generation, utilizing IPAdapter for style transfer and composition control, combined with SDXL for high-quality output. Key features:

  • Style Transfer: Applies color/texture from a reference image to the generated result.

  • Composition Control: Guides layout (e.g., product placement) via a composition reference image.

  • Auto Prompt Translation: Translates Chinese prompts to English for SDXL processing.

2. Core Models

Model/Component

Function

SDXL 1.0

Base generative model for high-resolution images.

IPAdapter

Enables precise style/composition transfer (requires ip-adapter-plus_sdxl_vit-h.safetensors).

LoRA

Enhances model for cosmetics/e-commerce scenes (e.g., Product Photography XL-V1).

3. Key Nodes

Node Name

Function

Installation

IPAdapterStyleComposition

Merges style and composition control signals.

Install via ComfyUI-Manager

IPAdapterUnifiedLoader

Loads IPAdapter models (manual download to models/ipadapter required).

Same

ImageScaleByAspectRatio

Resizes reference images to match target resolution (e.g., 1024x768).

Built-in or manager

LibLibTranslate

Translates Chinese prompts to English (requires LibLibAI plugin).

Plugin installation

Dependencies:

  • Download IPAdapter models from HuggingFace to models/ipadapter.

  • Place LoRA models in models/loras.

4. Workflow Structure

  • Group 1: Prompt Input

    • Input: Chinese prompts (e.g., "perfume bottle, lemon scent").

    • Process: Translated via LibLibTranslate and fed to CLIPTextEncode.

  • Group 2: Style Reference

    • Input: Style image (e.g., 11.jpg), resized by ImageScaleByAspectRatio.

    • Output: Standardized image for IPAdapterStyleComposition.

  • Group 3: Composition Reference

    • Input: Composition image (e.g., BL108.jpg), similarly resized.

    • Output: Combined with style image for generation control.

  • Group 4: Image Generation

    • Input: Prompts + style/composition conditions + LoRA.

    • Output: Final product image (e.g., perfume bottle scene).

5. Inputs & Outputs

  • Input Parameters:

    • Resolution (768x1024), seed value, Chinese prompts, style/composition images.

    • IPAdapter strength (default: 0.5), LoRA weight (default: 1.0).

  • Output:

    • PNG images saved to ComfyUI/output.

6. Notes

  • VRAM Requirement: SDXL+IPAdapter needs ≥12GB VRAM (RTX 3060+ recommended).

  • Common Errors:

    • Missing IPAdapter model triggers Missing IP-Adapter model.

    • Aspect ratio mismatch may cause distortion.

  • Optimization:

    • Reduce resolution or use --medvram mode.

    • Use high-contrast style references for better transfer.