Workflows

ComfyUI Infinite Upscale - Add details as you upscale your images using the iterative upscale node

In this tutorial, we will use ComfyUI to upscale stable diffusion images to any resolution we want! We will be using a custom node pack called "Impact", which comes with many useful nodes. We will also use the manager node. We will use these to scale up images we love while adding details and even injecting additional prompts along the way!

In this tutorial, we will use ComfyUI to upscale stable diffusion images to any resolution we want! We will be using a custom node pack called "Impact", which comes with many useful nodes. We will also use the manager node. I have linked that below as well. We will use these to scale up images we love while adding details and even injecting additional prompts along the way!

Step 0: Launch a basic SDXL workflow

To get started, open InstaSD and launch an "SDXL Base" instance.

Using this flow, let's try a simple image generation with these prompts:

  • Positive: "a nova scotia duck tolling retriever leaping in the air to catch a ball"
  • Negative: "text, watermark"
Step 1: Install the Impact pack

Once your ComfyUI instance is up, open the "Manager" and choose "Install Custom Nodes".

Search for "ComfyUI Impact Pack" and click "install". Once the install is complete, refresh the page.

Step 2: Add the Upscaler Flow

To add an iterative upscale to our base SDXL flow, we'll Impact Pack's "Iterative Upscale (Image)" node that is available under "upscalers". Go ahead and add that to the workflow.

The iterative upscaler works up to the upscale factor that you indicate in as many steps as you indicate. In this example, we scale up the image in 3 steps up to a 1.5 upscale factor.

This node upscales an image, so go ahead and connect its pixels input to the IMAGE output of the last VAE Decode node in the base workflow. The vae input of the upscaler node should be connected to the refiner model's vae output.

There's one input left on the iterative upscale node: upscaler. We'll add a PixelKSampleUpscalerProvider node to this input. Normally, we would simply set fixed values for our denoise ratio and the CFG scale. But since we're using an iterative upscaler, we can have these values change per each step of the upscale. We do this by adding two nodes (DenoiseScheduleHookProvider and CfgSheduleHookProvider) and we combine them with a PixelKSampleHookCombine and feed it into the pk_hook_opt of the provider. Here, we set a CFG of 6.5 on the provider and a target of 13 in the scheduler, and a denoise value of 0.3 on the provider with a target of 0.1 on the scheduler.

The provider also has inputs for model, vae, and positive/negative conditioning. Hook them up as follows:

  • model is the SDXL refiner model that we loaded.
  • vae is the vae of the refiner model.
  • positive/negative conditioning are our respective prompts, encoded with the CLIP of the refiner model.
Step 4 (Optional): Mid-iteration modifications

Using the iterative upscalers, we also have the opportunity to inject new prompts into the process. Instead of directly hooking up our encoded positive prompt into the positive input of the provider, we'll take a detour.

We'll add a new CLIP Text Encode (Prompt) node. CLIP for this node is that of our refiner model. The text in this node is the prompt that will be added during our upscale steps.

Next, we'll add a Conditioning (combine) node from Impact Pack. This allows us to combine the two conditioning outputs – the first from our original prompt and the second from our new prompt. Finally, output of the combine node is fed into the positive input of the provider.

Here, we've added the prompt "white paws, blue eyes" to our upscale flow. And here is the output:

Other Posts