Skip to content

tensorforger/comfyui-flow-upscaler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flow Upscaler ComfyUI Nodes

Flow Upscaler is a fast latent upscaler model that works in the Flux.2 latent space.

Under the hood, it is a lightweight Rectified Flow model with 59M parameters that generates upscaled latents in a single denoising step.

Download Weights

Features:

  • Upscaling from 512x512 to 1024x1024 takes 8ms*
  • The model is trained for 2X upscaling, but multiple passes can be chained to reach up to 8K resolution
  • A full pipeline with Flux generation, upscaling to 8K, and decoding runs in just 25 seconds (on RTX 5090)
  • The training process uses Flow Distillation with Flux.2 as a teacher, forcing the model to learn strong image semantics

*On RTX 5090, in latent space, without decoding, see benchmark here.

comparison

Here is one 4X upscaled image (workflow included):

example

Quick start

  1. Clone this repository into ComfyUI/custom_nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorForger/comfyui-flow-upscaler
  1. Download the model here and place it in:
ComfyUI/models/latent_upscale_models
  1. Optional, but recommended: Download the tiny Flux.2 VAE from here and place it in:
ComfyUI/models/vae_approx

Flow Upscaler can generate very large images, and decoding them with the original Flux.2 VAE becomes impractical. It is recommended to use the tiny VAE for resolutions of 2048x2048 and above.

  1. Open ComfyUI and load the demo workflow (workflow.json in the root of this repository).

How it works

Architecturally, Flow Upscaler is a U-Net with SDXL-style ResNet blocks. It takes a noisy sample as input and predicts velocity as output. The generation process happens directly in high-resolution latent space.

The low-resolution latents are passed through a separate conditioning encoder that produces control signals, which are injected into the main U-Net encoder using FiLM conditioning.

No attention layers are used, so compute scales linearly with image area. This makes generation at 8K resolution possible.

example

The model is trained using Flow Distillation with Flux.2-klein-4B as a teacher. We generated 20K diverse images with Flux, storing the initial noise, generated latents, and downscaled latents used for conditioning.

The downscaled latents are created by decoding high-resolution latents, downscaling them in pixel space, and encoding them back into latents. Direct latent downscaling introduces artifacts and breaks latent patterns, resulting in blurry decoded images.

example

Training code

If you want to explore the training code or use the model outside ComfyUI, see:

notebooks/flow_upscaler in https://github.com/tensorforger/CTGMWorkshop

About

A set of ComfyUI nodes for FlowUpscaler - a fast Flux.2 latent upscale model

Topics

Resources

Stars

20 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages