Skip to content

🎨 Fill in masked parts of images with FLUX.1-dev πŸ–ŒοΈ

License

Notifications You must be signed in to change notification settings

zsxkib/cog-flux-dev-inpainting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FLUX.1 DEV Inpainting Model

🎨 Fill in masked parts of images with FLUX.1-dev πŸ–ŒοΈ

About

This is a version of the Flux DEV inpainting model by @skalskip92. We've changed it to keep the original image's shape. The model expects the mask to be the same size as the input image, but you can change this with some settings.

Big thanks to @Gothos13 for helping create this clever inpainting method.

How to Use

You can use this model with Cog. Here's an example command:

sudo cog predict \
  -i 'mask="https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png"' \
  -i 'image="https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png"' \
  -i 'prompt="small cute cat sat on a park bench"' \
  -i 'strength=1' \
  -i 'num_inference_steps=30' \
  -i 'guidance_scale=7' \
  -i 'output_format="webp"' \
  -i 'output_quality=90'
Input Image Mask
Input Image Mask

Output:

Output Image

Tips for Use

  • For better results, try using more steps (between 20-30) when creating the image.
  • Play around with the inpainting 'strength'. Numbers between 0.85-1.0 often work well, but you might need different strengths for different prompts.
  • Keep in mind that Flux wasn't specially trained for inpainting. There are no specific inpainting parts, which makes this a smart way to use the model's skills.
  • The model can still handle text in images.

Note

This inpainting method can make great images, but you might need to try a few times to get what you want. Don't give up if your first try doesn't look perfect!

For more info and updates, check out the original tweet thread.

Support

If you like my work, please follow me! @zsakib_

About

🎨 Fill in masked parts of images with FLUX.1-dev πŸ–ŒοΈ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages