santa hat
deerdeer nosedeer glow
Sign In

Using comfy to batch process images with lama cleaner

Jul 20, 2024
workflows
Using comfy to batch process images with lama cleaner

Using comfy to batch process images with lama cleaner

This workflow uses DINO + SAM models for detecting what you want to detect in the images and remove the detected areas with lama model.

For example you can detect text in the images and remove it.

DISCLAIMER:

This workflow uses models for detection and removing. The results can sometimes be unwanted.

This workflow will download models that total to around 4-5GB.

VRAM required is around 6-7gb?

You can find and download the workflow HERE

The workflow

Parts of the workflow / HOW TO USE

  1. Settings

    Here you insert the path for the images, mode and possibly mute other parts for testing purposes before saving.

  2. DINO + SAM


    This part does the detection of what you want to detect. You can select which models you want to use. I do not know how the smaller models perform, personally use the bigger ones for better detection.

    In the "GroundingDinoSAMSegment" you select what you want to detect. For example in this image i am detecting "text" in the image.

    Rest of the nodes are for image preview

  3. Lama cleaner part of the workflow

    This part uses lama cleaner to clean the masked area.

    You have to select upscale model for better result. Most likely throws error if you do not select upscale model you have.

  4. Saving

    Saves the image with original filename to comfyui outputs folder.

  5. Preview


    Preview shows the results from each steps

From "extra options" you can set batch size to match your image count OR you can put to auto que and stop it when it is ready. Image saves with the original image and once it reaches end. It will start the loop again and overwrite the previously done images.

9

Comments