Ancient Beauty Generation Unveiled: Stable Diffusion Meets SUPIR

CN
ComfyUI.org
2025-04-11 10:29:25

1. Workflow Overview

m9cna1sel1scy81163cf0321cf394854ac0ec62b2120e2b7e3debe625825e826a5739e0195571d4fad.png
  • Function: Generates high-quality images of ancient-style beauties holding umbrellas, with face/hand refinement, face-swapping, and SUPIR upscaling.

  • Goal: Combine LoRA models and SUPIR to enhance stylized portrait generation.

  • Key Models:

    • Stable Diffusion 1.5 (Base: majicMIX realistic_v7).

    • SUPIR-v0F (Fast upscaling model).

    • ControlNet (YOLOv8 for face/hand detection).

    • LoRA Stack (e.g., Ancient Beauty LoRA, Hand Fix LoRA).


2. Node Breakdown

Critical Nodes:

  1. CheckpointLoaderSimple: Loads base model (e.g., majicMIX realistic).

  2. CR LoRA Stack: Dynamically merges multiple LoRAs (costume, hand fix, detail enhancer).

  3. KSampler: Controls generation (sampler: dpmpp_2m, steps 25-50).

  4. FaceDetailer/HandDetailer: Repairs faces/hands using YOLOv8 detectors.

  5. SUPIR_sample: Upscales images with tile-based processing.

  6. ReActorFaceSwap: Swaps faces (requires source portrait).

Dependencies:

  • SUPIR Models: Download SUPIR-v0F_fp16.safetensors to models/supir.

  • UltralyticsDetector: Install comfyui-controlnet-aux for bbox/face_yolov8m.


3. Workflow Structure

Group Logic:

  1. Model Loading:

    • Input: Base model, LoRAs, VAE.

    • Output: Loaded model + CLIP encoder.

  2. Prompts:

    • Input: Positive/Negative prompts (e.g., "hanfu, umbrella").

    • Output: Conditioned text tensors.

  3. Image Generation:

    • Input: Empty latent (512x768), text conditions, seed.

    • Output: Raw generated image.

  4. Refinement & Upscale:

    • Input: Raw image, face/hand detectors.

    • Output: 2K upscaled image via SUPIR.


4. Inputs & Outputs

Inputs:

  • Required: Positive/Negative prompts, seed (randomizable).

  • Optional: Face-swap source image, SUPIR scale (default 4x), CFG (default 4).

Outputs:

  • Final image: 2K PNG with metadata.


5. Notes

  1. Hardware: β‰₯8GB VRAM; SUPIR needs extra memory.

  2. Common Errors:

    • Missing SUPIR model: Check models/supir.

    • Face repair fails: Adjust FaceDetailer threshold (default 0.55).

  3. Optimization:

    • Reduce encoder_tile_size (e.g., 512) for lower VRAM usage.

    • Enable fp8_unet if GPU supports FP8.