Nodes Browser
ComfyDeploy: How ComfyUI-DiffusersImageOutpaint works in ComfyUI?
What is ComfyUI-DiffusersImageOutpaint?
ComfyUI nodes for outpainting images with diffusers, based on [a/diffusers-image-outpaint](https://huggingface.co/spaces/fffiloni/diffusers-image-outpaint/tree/main) by fffiloni.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI-DiffusersImageOutpaint
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI nodes for outpainting images with diffusers, based on diffusers-image-outpaint by fffiloni.
Updates:
- 17/11/2024:
- Added more options to Pad Image node (resize image, custom resize image percentage, mask overlap percentage, overlap left/right/top/bottom).
- Side notes:
- Now images with round angles work, since the new editable mask covers them, like in the original huggingface space.
- You can use "mask" and "diffusers outpaint cnet image" outputs to preview mask and image.
- You can find in the same workflow file the workflow with the checkpoint-loader-simple node and another one with clip + vae loader nodes.
- 22/10/2024:
- Unet and Controlnet Models Loader using ComfYUI nodes canceled, since I can't find a way to load them properly; more info at the end.
- Guide to change model used.
- 20/10/2024: No more need to download tokenizers nor text encoders! Now comfyui clip loader works, and you can use your clip models. You can also use the Checkpoint Loader Simple node, to skip the clip selection part.
- 10/2024: You don't need any more the diffusers vae, and can use the extension in low vram mode using
sequential_cpu_offload
(also thanks to zmwv823) that pushes the vram usage from 8,3 gb down to 6 gb.
To do list to change model used:
-
- ✅ ComfyUI Clip Loader Node
- ~⬜ ComfyUI Load Diffusion Model Node~ (more info below)
- ~⬜ ComfyUI Load Conotrolnet Model Node~ (more info below)
Installation
- Download this extension or
git clone
it in comfyui/custom_nodes, then (if comfyui-manager didn't already install the requirements or you have missing modules), from comfyui virtual env writecd your/path/to/this/extension
andpip install -r requirements.txt
. - Download models in comfyui/models/diffusion_models:
- (Dual) Clip Loader node: if you use the Clip Loader instead of Checkpoint Loader Simple, and want to use RealVisXL_V5.0_Lightning, it works with
clip_I
andmodel.fp16
(from sdxl-base), andsdxl type
; you can use this workflow.
Overview
- Minimum VRAM: 6 gb with 1280x720 image, rtx 3060, RealVisXL_V5.0_Lightning, sdxl-vae-fp16-fix, controlnet-union-sdxl-promax using
sequential_cpu_offload
, otherwise 8,3 gb; - ~As seen in this issue, images with square corners are required~.
The extension gives 4 nodes:
- Load Diffusion Outpaint Models: a simple node to load diffusion
models
. You can download them from Huggingface (the extension doesn't download them automatically); - Paid Image for Diffusers Outpaint: this node resizes the image based on the specified
width
andheight
, then resizes it again based on theresize_image
percentage, and if possible it will put the mask based on thealignment
specified, otherwise it will revert back to the default "middle"alignment
; - Encode Diffusers Outpaint Prompt: self explanatory. Works as
clip text encode (prompt)
, and specifies what to add to the image; - Diffusers Image Outpaint: This is the main node, that outpaints the image. Currently the generation process is based on fffiloni's one, so you can't reproduce a specific a specific outpaint, and the
seed
option you see is only used to update the UI and generate a new image. You can specify the amount ofsteps
to generate the image.
You can also pass image and mask to vae encode (for inpainting)
node, then pass the latent to a sampler
, but controlnets and ip-adapters won't always give good results like with diffusers outpaint, and they require a different workflow, not covered by this extension.
Change model used
- Main model: On huggingface, choose a model from text2image models (sdxl and maybe sd1.5 model types should work, while flux doesn't), then create a new folder named after it in
comfyui/models/diffusion_models
, then download in it the subfoldersunet
(if not available usetransformer
) andscheduler
.- Hint: sometimes in the
unet
ortransformer
folder there are more model files and not all are required. If you havemodel.fp16
andmodel
, I suggest you to use the fp16 variant; if you havemodel-001-of-002
,model-002-of-002
,model
, choose model (instead of the fragmented version).
- Hint: sometimes in the
- Controlnet model: download
config.json
and the safetensorsmodel
.
Unet and Controlnet Models Loader using ComfYUI nodes canceled
I can load them but then they don't work in the inference code, since comfyui load diffusers models in a different format (reddit post).
Credits
diffusers-image-outpaint by fffiloni