CivArchive
    Utopian Inpainting workflow - v2.1
    Preview 117806562

    Over view

    This is a simple workflow designed to closely reproduce the inpainting features available in WebUI. And specifically designed for use with my model, Utopian Inpainting.

    Update: Changed sam2 to sam3
    Old update: Added Openpose, Detail daemon, fill mask area, basic Adetailer, and more.
    I realized the pure SDXL models is good as a refiner. After testing several options, Epic Realism delivered good performance with both high-resolution and low-resolution images.
    Set the sampler 2 configuration to "dpmpp_2m_sde" "karras" and try adjusting the "refiner ratio" to around "0.6 to 0.8"

    -Basic feauture-

    • Inpainting with refiner model

    • Inpainting full image and crop image select

    • Pre-resize image with scale by % and long_side resize select

    • Basic K-sampler and Lanpaint support

    • Manual mask and sam2 Auto masking select

    • Optional Vae and Clip selector

    • Postprocess Mask detailer (testing)

    Upcoming Update plan: Outpainting Support, More Accurate Auto masking.

    -How to use-

    Resources you need:

    Settings:

    [Optional loader]
    Select if you want to use Clip or VAE instead.

    [Inpaint mode]
    -Normal
    Normal Inpainting.
    -Refiner
    Inpainting with refiner.
    -Lanpaint
    Use Lanpaint, The output results are different from Ksampler. It is difficult to say which is better.

    [Resize method]
    -percentage
    Pre-resize image with scaled %.
    -Long side
    Pre-resize the image based on the long edge.

    [Inpaint area]
    full
    Inpaint with pre-resized image size.
    -crop
    Crop pre-resized image according to mask.

    • crop target size
      Scales the size of the crop from the image.

    Cropped_image = Original_img * Pre-resize * crop_target_size
    • crop mask extend
      How much of the image to crop from the mask.

    [Mask method]
    -Manual
    Right-click on the load image and select "Open in mask editor" to manually draw a mask.
    -Auto
    A mask is generated automatically; use the mask prompt to define the area you want to mask.

    [Postprocess]
    -After Detailer
    Enhance the Inpainted image by running a mild inpainting pass after finished.
    -with refiner
    Also use refiner model when Detailer. (With refiner doesn’t perform well at the moment)

    • Detailer denoise
      recommended 0.3 ~ 0.5

    • Detailer zoom
      Set how much of the surrounding area is included when cropping.
      The higher the value, the more area around the mask will be cropped.

    Description

    Refine mode has been refined, applying a negative prompt for i2i for better result.
    Quality-tags in negative prompts bad affect inpainting, so they are separated.
    Mask blur has been separated into full and crop modes, and a slider has been added.

    FAQ

    Comments (9)

    willshawn2519Feb 5, 2026
    CivitAI

    Hi, thank you for great workflow.
    I have an error when enabling auto mask.

    SAM2Segment

    'BertModel' object has no attribute 'get_head_mask'

    Please suggest workaround if you have any idea,
    thank you.

    habibing
    Author
    Feb 6, 2026· 1 reaction

    This is probably due to the fact that transformers are not installed or the versions are inconsistent.

    willshawn2519Feb 7, 2026

    @habibing I think numpy version is the problem, although i cannot update it due to some other reasons.

    Anyway, there is one another issue I encountered.
    Tried to use Waifu inpaint XL model, when loading separate VAE through "Enable load VAE", and activating Refiner, the inpaint result is awful. I guess it's some VAE conflict, can you please look into it?

    habibing
    Author
    Feb 7, 2026· 1 reaction

    I have confirmed that grounding dino is no longer available in the latest ComfyUI environment. Automask will be changed to Sam3.
    And also confirmed an issue where the loaded Vae was not being used preferentially, so I have fixed it. Inpaint models and refiner models require VAE compatibility.
    Thank you.

    willshawn2519Feb 9, 2026

    @habibing Wow, thank you for the quick fix.

    willshawn2519Feb 13, 2026

    @habibing Hi, can I ask one more question?

    It seems that simply adding InvertMask node between LoadImage and GetMaskRaw doesn't work as I intended.

    The purpose is to try refining the textures EXCEPT FACE in general with various finetune models (in low denoise). Can you advise how I can mask the face only to actually refine the image except face?

    habibing
    Author
    Feb 13, 2026

    (set) Mask emb is the final mask passed to the sampler. If you manually mask only the face and want to invert it, you should insert it before that. However, be careful as my switches method are very messy.

    willshawn2519Feb 14, 2026· 1 reaction

    @habibing it works fine, thank you!

    willshawn2519Feb 19, 2026

    I wish the same workflow exists for qwen image edit... desperately need the face crop-inpainting with reference image

    Workflows
    Illustrious

    Details

    Downloads
    204
    Platform
    CivitAI
    Platform Status
    Available
    Created
    1/17/2026
    Updated
    5/19/2026
    Deleted
    -

    Files

    utopianInpainting_v21.zip

    Mirrors

    HuggingFace (1 mirrors)
    CivitAI (1 mirrors)