CivArchive
    Preview 56335092

    Update the plugin to latest version to avoid incorrect placement during large buffer and close to edge mask

    Comfyui-In-Context-Lora-Utils (20241214)

    v3.4 update:

    Use kontext to improve workflow

    v3.3g update:

    a simple workflow for dev ic lora using new nodes.

    v3.3f update:

    Fix missing connection on crop mask to original result

    Usage:

    Input two images

    mask the target area from image 1 as reference

    mask the target area from image 2 as editing area

    Parameter:

    https://civarchive.com/articles/9292 

    中文视频讲解:

    https://www.bilibili.com/video/BV19MiZYJE82/?vd_source=1f3b87e4654ce717c5f87bb51a78ffc0

    Sponsors me for more open source project:

    Buy me a coffee:

    WeChat

    v3.3 update:

    Add auto mask before final output.

    Move parameter above load image section for more space.

    Adjust fit image logic, update logic to avoid cropping image.

    Adjust plugin calculation to avoid incorrect replacement.

    v3.2 update:

    add prompt and redux switch.

    add one step refine.

    Update the latest plugin, 2024-12-05, for v3.2: Comfyui-In-Context-Lora-Utils

    v3.1 update:

    Add AutoPatch Node to avoid patch mode and patch type selection.

    Fix incorrect width height in edge case which lead to incorrect resize and incorrect replace in final result

    v3.0 update: To adjust lossy detail issue, I develop new nodes for this context window editing workflow.

    Download the latest plugin for v3.0: Comfyui-In-Context-Lora-Utils

    v3.0 workflow enable any context window editing with provided mask and image.

    It could create very small context window from source image and replace it back to the original image.

    v2.4 update: Based on another person created workflow, improve image process logic with my Comfyui-In-Context-Lora-Utils

    PS: demo image is created by 书墨旅人 from a wechat group.

    v2.3 update: Two pass sampler to increase the consistency

    v2.2 update: Fix missing flux guidance issue

    v2.1 update: Remove Lora from the workflow

    v2.0 update: Add Target Image And Accept Mask Input

    PS: Need the latest Comfyui and newly release inpainting flux model

    PS2: You might need to adjust seed a few time to get the best result

    Download Inpainting Flux Model (Fill) Here:

    https://huggingface.co/black-forest-labs/FLUX.1-Fill-dev/tree/main

    V2.0 extention:

    https://github.com/lrzjason/Comfyui-In-Context-Lora-Utils

    ## How to install
    Download the zip file.
    Extract to ..\ComfyUI\custom_nodes.
    Restart ComfyUI

    For try on lora, you could download from below:

    https://civarchive.com/models/950111/flux-simple-try-on-in-context-lora

    v1.3 update: added new plugin for simplify in context lora workflow

    v1.2 update add more description and tips

    add Ratio Based on 1024 for high resolution generation

    The remove background node need the ckpt from below url

    https://github.com/chflame163/ComfyUI_LayerStyle?tab=readme-ov-file#TransparentBackgroundUltra

    As newly discoved in context lora usage of Flux.

    https://ali-vilab.github.io/In-Context-LoRA-Page/

    We could use image as condition to generate similar output.

    I introduce this workflow to simply remove the ic-lighting and inpainting models for product background editing.

    Please use with this lora:

    https://civarchive.com/models/933026/flux-product-design-in-context-lora

    Modify the Main Description to descript the input image.

    Modify the Extra Description to descript the wanted image. You could refer [IMAGE1] in Extra Description.

    For example:

    Main Description: This is a picture of a gold pendant. The design of the pendant is very unique, shaped like a pair of spread wings with a heart-shaped hollow in the middle. The whole pendant presents a delicate and elegant feeling, suitable for use as a necklace or bracelet ornament.

    Extra Description: A beatiful woman wearing [IMAGE1] walking on street

    Feel free to dm me if you have any query.

    Contact: [email protected]

    QQ Group: 866612947

    Description

    FAQ

    Comments (13)

    Famous_Assistant5390584Feb 25, 2025
    CivitAI

    Is there an in-depth English explanation of the workflow? There only seems to be a Chinese video that is not very helpful and it appears to be only about an over version. I can not get this to work. all the workflow genrates is a SAM2 mask for the second picture. the dexription says there is a prompt do descibe the source picture and another one to desribe the final image. But there is only one prompt box that isn't even used in the video.

    xiaozhijason
    Author
    Feb 25, 2025

    There is option to use prompt or redux to extract information from the image. You could select it in the parameter panel, Guidance Type. When using redux, it doesn't need to enter prompt. Upload image, SAM mask and transfer. You might refer this article for some parameters: https://civitai.com/articles/9320/fix-hand-using-context-window-editing-workflow-fluxredux You also could use this workflow and using manual mask by disabling(bypass) the same node.

    manos39346Apr 19, 2025· 1 reaction
    CivitAI

    Given the goal of transferring a specific person from a source image (containing a person) into a target image that currently contains no people, what should I do, or would you recommend the steps please ?

    NeverWasApr 22, 2025
    CivitAI

    大佬,看我,回复下谢谢!(第一个是:我把手机移动到图片中的一个托盘上,我怎么做才可以确保手机只移动到我涂抹了蒙版的部分,而不要超出蒙版?)(第二个是我怎么做才可以确保手机上的挂绳,也跟着去新图上面呢?)

    xiaozhijason
    Author
    Apr 23, 2025

    用fill理论上只会重绘到蒙版区域

    NeverWasApr 23, 2025
    CivitAI

    我用了3.3g版本的工作流,剪切了你样图左边的汽车图,使用样图自带的工作流,生成的橘色甲壳虫与输入图片很相似,但是!!在其他所有不变的情况下,一旦我改了种子号,出来的汽车完全不一样了。这是为什么啊?我会在下面发布汽车图。

    GrzesMisApr 24, 2025· 22 reactions
    CivitAI

    DONT INSTALL IT! IT HAS INFECTED NODE: bizyair

    CratertempusOct 28, 2025

    Not anymore it seems

    wutaMay 3, 2025
    CivitAI

    Hello, is it possible to use this workflow with multiple input images of garment (for example, back and front) similar to what this achieves? : https://github.com/hywang2002/MV-VTON

    Thank you

    xiaozhijason
    Author
    May 3, 2025

    This workflow is designed to use two images. It needs to adjust multiple things to adapt with multiple inputs

    ansh454May 15, 2025
    CivitAI

    the workflow is v3.3f not v3.3g

    xiaozhijason
    Author
    May 15, 2025

    3.3g is for ic lora. It is next to 3.3f.

    xiaozhijason
    Author
    May 15, 2025

    the main version is 3.3f for people who use fill and redux. 3.3g is the lite version removed most things for understanding the node logic

    Workflows
    Flux.1 D

    Details

    Downloads
    642
    Platform
    CivitAI
    Platform Status
    Available
    Created
    2/7/2025
    Updated
    5/26/2026
    Deleted
    -

    Files

    fluxKontextWindow_v33gDevIcLoraLite.zip

    Mirrors