CivArchive
    UndoMask_lora - v2.0
    NSFW
    Preview 86850583
    Preview 86850608
    Preview 86850617

    ※This LoRA is an early experimental work, so it is not necessarily superior to other methods.

    reconstruction quality is not very high. Please consider this as an experiment to demonstrate what is possible.Inpainting with other models will likely achieve higher accuracy.

    ■If you're new to Kontext, try installing it using the instructions at the URL below.

    It's well-documented and easy to set up.

    https://docs.comfy.org/tutorials/flux/flux-1-kontext-dev

    ■It reconstructs masked areas artificially.

    Kontext already has features to detect and restore such masks, but since it may not always work perfectly, this LoRA was made to support that.

    It improves detection of mosaics, fill-ins, and lines like those in the sample images.

    Since copyrighted material can't be used, I used AI-generated fruit images as samples.

    The sample image is easy to detect and reconstruct due to clear masks and surrounding context, but real masked images are often more complex and harder to handle.

    ■The prompt below has high mask detection and can be a good starting point.

    It was also used as a caption during LoRA training.

    Detect all forms of censorship in the image — including mosaic, blur, black or white bar censor, pixelation, filled areas, and identity censor — and accurately restore the censored regions. Prioritize faithful reconstruction of the original uncensored content based on logical structure and visual context. Ensure that the restored areas retain the intended texture, shape, and detail of the uncensored version.

    ■It works well as is, but try adjusting the prompt to better match your desired result.
    However, prompt tuning alone has limits for improving detection and reconstruction quality.

    ■The reconstruction quality is not guaranteed to be high.

    Thin masks like lines are easier to infer using surrounding context, but fully covered areas may fail to reconstruct correctly due to lack of detail or texture cues.

    ■If there are too many masked areas, the model may fail to recognize what should be restored.

    In such cases, splitting the image and simplifying the masked area can help improve results.

    Try cropping only the area around the part you want to remove.

    Color correction can also help improve detection beforehand.

    For example, scanned images may be faded or low-contrast, so adjusting contrast is effective.

    Masks filled with dark gray or unclear tones can also be easier to detect if contrast is adjusted to make them pure black.

    If print dots are visible, they may interfere with detection. In some cases, it may be better to redraw clean black mask lines yourself for better clarity.

    ■Also, since this LoRA is an early experiment, it may recover general shapes but struggles with realistic textures or fine details.

    Apologies for the low-effort result—please understand its limitations.

    For better results, using inpainting or 0.25-0.5 denoise i2i with another model might be more effective.

    SD1.5 is lightweight and performs well even at high resolutions, making it a great choice for i2i tasks.

    It works as an excellent refiner and can sometimes produce surprisingly better results than expected.

    If you have enough VRAM, SDXL could also be a good option to consider.

    ■I used AI Toolkit to train this LoRA.

    If you're interested in training, the developer has provided a tutorial at the URL below — give it a try!

    I think you'll find it's easier than you might expect.

    Dataset Details:

    Following the tutorial, I trained the LoRA using 50 images.

    ■ These 50 unmasked images represent the final edited results and were used as the target side.

    ■ I manually added various mask types to likely masked areas using an image editor and used those as the control side.

    Most are anime-style, but some real photos are included.

    To increase diversity, I prepared a variety of scenarios.

    Description

    Training Data (7.37 KB):comfyui workflow

    ■added 23,250 more training steps.

    ■Compared to before, reconstruction accuracy and detail have slightly improved.

    ■It may be slightly overfitted, resulting in some visible JPEG artifacts from the dataset. Lowering the LoRA weight might help.

    ■I also changed the sampler in the workflow to gradient estimation.

    It converges faster than Euler and produces sharper images at the same step count.

    ■If you're not satisfied with the reconstruction or details, try inpainting or i2i with another model.

    SD1.5 is lightweight and works well as a high-resolution refiner—recommended for i2i. It only uses about 2GB of VRAM, but it's very powerful.

    It performs reliably up to 1024×1536px.

    Try denoise values between 0.25–0.5

    ■If you're unsure which SD1.5 model to use, feel free to try my merged SD1.5 models first.

    I provide both real and anime styles—use whichever fits your image better.

    If the results don’t match your expectations, you can then look for a model closer to your ideal!

    https://civitai.com/models/1246353/sd15modellab

    ■If you have enough VRAM, SDXL could also be a good option.

    ■The sample images are reused from earlier.

    FAQ

    Comments (5)

    FizeeJul 9, 2025· 3 reactions
    CivitAI

    does it work with "those things"? if you know what I mean...

    hjhf
    Author
    Jul 9, 2025

    Well, the games and manga I like somehow tend to include that kind of expression, so it should work effectively for them.

    Also, if you're not satisfied with the details or texture, using i2i with another model might help.

    tiru92Jul 12, 2025· 1 reaction
    CivitAI

    "For better results, using inpainting or 0.25-0.5 denoise i2i with another model might be more effective."

    Regarding this can you provide a workflow for comfyui so i can learn.

    hjhf
    Author
    Jul 12, 2025

    I’ve updated the workflow to include SD1.5 i2i, so please download it again!

    If you'd prefer to use SDXL, you can switch the checkpoint and adjust a few settings accordingly.

    Apologies, I don’t have experience with inpainting, so I couldn’t include it in the workflow.

    It should just require adding nodes to handle masks as input for i2i, but feel free to look into it if needed.

    Alternatively, you could use image editing software to combine only the parts you want to change with the original image.

    tiru92Jul 12, 2025· 1 reaction

    @hjhf thank you mate, this will help a lot.

    LORA
    Flux.1 Kontext
    by hjhf

    Details

    Downloads
    1,804
    Platform
    CivitAI
    Platform Status
    Available
    Created
    7/7/2025
    Updated
    5/21/2026
    Deleted
    -

    Files

    undomask_workflow_v02.zip

    Mirrors

    CivitAI (1 mirrors)

    undomask_workflow_v02.zip

    Mirrors

    HuggingFace (1 mirrors)
    CivitAI (1 mirrors)

    censord_02_000030000.safetensors