πŸš€ Transform Your Photos into Anime Masterpieces with AI!

CN
ComfyUI.org
2025-03-20 16:51:41

πŸ› οΈ Workflow Overview

m8h46tchgxo17p35gce7387372669f8177314af46b9e6e275c3b7c5dc664c9deb9993510ef7cc62418c.png

Purpose and Function:
This workflow automatically converts real-life photos into anime-style images. It combines upscaling models, VAE encoding/decoding, sampling, and facial enhancement to generate high-quality anime images with refined facial features and improved resolution.

Core Features:

  1. Image Preprocessing: Loads and resizes the input image.

  2. Anime Style Conversion: Uses custom anime-style models to transform the real image.

  3. Facial Refinement: Enhances facial details and fixes imperfections.

  4. Final Output: Displays and saves the high-resolution anime-style image.


πŸ”₯ Core Models

  1. WAI_NSFW-illustrious-SDXL_v11

    • Function:

      • The primary model for transforming real-life photos into anime-style images.

    • Installation:

      • Install using ComfyUI Manager or manually:

      • Download the .safetensors file and place it in the models/Stable-diffusion directory.

  2. 4x-AnimeSharp (Upscaling Model)

    • Function:

      • Enhances the image resolution and sharpens details.

    • Installation:

      • Place the model file in models/UpscaleModels.

      • Alternatively, install it using ComfyUI Manager.


βš™οΈ Nodes Explanation

  1. LoadImage

    • Function:

      • Loads the real-life image into the workflow.

    • Input:

      • Image file path.

    • Output:

      • Image data.

  2. UpscaleModelLoader

    • Function:

      • Loads the upscaling model used to enhance the image resolution.

    • Parameters:

      • 4x-AnimeSharp

    • Output:

      • Upscale model.

  3. ImageUpscaleWithModel

    • Function:

      • Applies the upscaling model to enlarge the image.

    • Input:

      • Image

      • Upscale model

    • Output:

      • Upscaled image.

  4. VAEEncode

    • Function:

      • Encodes the image into the latent space for further processing.

    • Input:

      • Image

      • VAE model

    • Output:

      • Latent image data.

  5. KSampler

    • Function:

      • Samples the latent image to generate the anime-style output.

    • Parameters:

      • Sampling method: euler_ancestral

      • Sampling steps: 30

      • CFG scale: 0.6

    • Input:

      • Model

      • Positive and negative prompts

      • Latent image

    • Output:

      • Latent anime-style image.

  6. VAEDecode

    • Function:

      • Decodes the latent image into a visual image.

    • Input:

      • Latent image

      • VAE model

    • Output:

      • Anime-style image.

  7. CLIPTextEncode

    • Function:

      • Encodes the textual prompt into conditioning data.

    • Input:

      • Text prompt.

    • Output:

      • Conditioning data (CONDITIONING).

  8. CLIPSetLastLayer

    • Function:

      • Adjusts the last layer of the CLIP model for better prompt guidance.

    • Input:

      • CLIP model.

    • Output:

      • Modified CLIP model.

  9. SaveImage

    • Function:

      • Saves the final anime-style image to the local storage.

    • Input:

      • Image.

    • Output:

      • None (saves the file).


🧩 Workflow Structure

βœ… Group 1: Image Upload

  • LoadImage β†’ Loads the real-life image.

  • UpscaleModelLoader β†’ Loads the 4x-AnimeSharp model.

  • ImageUpscaleWithModel β†’ Applies the upscaling model to enhance image resolution.

βœ… Group 2: Model Prompts

  • CLIPSetLastLayer β†’ Adjusts the CLIP model's final layer.

  • CLIPTextEncode β†’ Applies positive and negative prompts:

  • Positive prompts:

  • masterpiece, best quality, amazing quality

  • Negative prompts:

  • teeth, cleavage, (worst quality:1.65), (low quality:1.2), low resolution, watermark, dark spots, blemishes, dull eyes, wrong teeth, red teeth, bad tooth, multiple people, broken eyelashes

βœ… Group 3: Initial Image Processing

  • VAEEncode β†’ Encodes the image into the latent space.

  • KSampler β†’ Samples the latent image using the anime model.

  • VAEDecode β†’ Decodes the sampled latent image into the final anime-style image.

βœ… Group 4: Facial Refinement

  • The workflow uses facial enhancement to fix imperfections, such as blurry or distorted facial features.

βœ… Group 5: 4K Upscaling

  • scale β†’ Applies 4K upscaling to improve image quality and resolution.

βœ… Group 6: Final Output

  • SaveImage β†’ Saves the final anime-style image to the local storage.


πŸ”₯ Inputs & Outputs

βœ… Inputs:

  • Real-life image.

  • CLIP positive and negative prompts.

  • Upscaling model.

  • Anime-style generation model.

  • Sampling parameters (steps, CFG scale, etc.).

βœ… Outputs:

  • High-resolution anime-style image with refined facial details.


⚠️ Considerations

  1. Hardware Requirements:

    • This workflow involves multiple model loads, VAE encoding/decoding, and upscaling, requiring a GPU with at least 12GB of VRAM for optimal performance.

  2. Resolution Limitations:

    • High-resolution input images (above 1600x1200) may cause VRAM overflow.

    • To avoid instability, limit the image size to 1600x1200 or smaller.

  3. Compatibility:

    • Ensure the ComfyUI and model versions are compatible to prevent errors.

  4. Output Quality Control:

    • Use negative prompts to filter unwanted artifacts, such as noise, blurriness, or facial imperfections.