How to outpaint with Flux Fill model

Published Categorized as Tutorial Tagged , No Comments on How to outpaint with Flux Fill model

The Flux Fill model is an excellent choice for inpainting. Do you know it works equally well for outpainting (extending an image)? In this tutorial, I will show you how to use the Flux Fill model for outpainting in ComfyUI.

Original
Image outpaint with flux fill model
Outpainted

Software

We will use ComfyUI, an alternative to AUTOMATIC1111. You can use it on Windows, Mac, or Google Colab. If you prefer using a ComfyUI service, Think Diffusion offers our readers an extra 20% credit.

Read the ComfyUI beginner’s guide if you are new to ComfyUI. See the Quick Start Guide if you are new to AI images and videos.

Take the ComfyUI course to learn how to use ComfyUI step-by-step.

What is the Flux Fill model?

Model

The Flux.1 Fill model is an inpainting model. It is trained to fill in missing content while maintaining maximum consistency with the rest of the image.

The Flux.1 Dev Fill model is a fast version of the Flux.1 Pro Fill model. It is sped up using guidance distillation and denoises without classifier-free guidance (CFG). The result is a twofold speedup with a slight degradation in quality.

License

The Flux.1 Dev Fill model is under the same non-commercial Flux.1 Dev license. You can use the images generated by the model for commercial purposes.

VRAM requirement

This model is memory-hungry. You need an NVidia card with 24 GB VRAM to run this workflow.

Outpainting using Flux vs Flux Fill model

You can outpaint with the original Flux checkpoint model. Why the Fill model? The benefit is that you can use the maximum denoising strength (1) while maintaining consistency with the original image.

Step-by-step guide

Step 0: Update ComfyUI

Before loading the workflow, make sure your ComfyUI is up-to-date. The easiest way to do this is to use ComfyUI Manager.

Click the Manager button on the top toolbar.

Select Update ComfyUI.

Restart ComfyUI.

Step 1: Download the fill diffusion model

Visit the Flux.1 Fill model page and click “Agree and access repository.”

Download the Flux.1 Dev fill model and save it to the ComfyUI > models > diffusion_models folder.

(If you use Google Colab: AI_PICS > models > diffusion_models)

Step 2: Download the CLIP models

Download the following two CLIP models, and put them in ComfyUI > models > clip.

(If you use Google Colab: AI_PICS > models > clip)

Step 3: Download the Flux VAE

Download the Flux VAE model file. Put it in ComfyUI > models > vae.

Step 4: Load the workflow

Download the workflow JSON file below and drop it to ComfyUI.

Step 5: Load image

Load the image you want to outpaint in the Load Image node.

You can download the test image below.

Step 6: Specify the extension

Specify the number of pixels you would like to extend in each direction (left, top, right, and bottom) in the Pad Image for Outpainting node.

In this example, I will extend the left and right-hand sides by 400 pixels.

Step 7: Enter a prompt

Enter a prompt to describe the extended area. It can be as simple as a few words.

city, buildings

Step 8: Generate the new image

Click Queue to start outpainting.

You can see how well the image is seamlessly extended!

Notes

Change the seed value in the KSampler node to generate a different image.

Avatar

By Andrew

Andrew is an experienced engineer with a specialization in Machine Learning and Artificial Intelligence. He is passionate about programming, art, photography, and education. He has a Ph.D. in engineering.

Leave a comment

Your email address will not be published. Required fields are marked *