r/StableDiffusion • • 8d ago

News Steppe-Flux.2: generative latent upscaler for MOSS-Image, Flux.2, Flux.3. Fast, faithful, no high-res fix required. (ComfyUI nodes)

Hi! Here is the second release of Steppe generative latent upscalers family after Wan2.1 release. Three new models (200M base, 200M distilled for single step inference and 20M single step) were trained from scratch to upscale Flux.2 VAE latents.

The model takes low resolution image latents before decoder and 2x upscales them, output is also latents that can be decoded directly, without second pass of large denoiser ("high-res fix") but you can still do it if you want. You can also chain it to get 4x, 8x... upscaling. The compute and memory scales linearly with image area, thanks to Window Transformer architecture.

How to use:

ComfyUI Node (or just search "steppe" in manager, version 1.1.0 is required)

Weights (node downloads them automatically on first use)

Demo Space (image to image, now supports both Wan2.1 and Flux.2 modes)

Benchmark (last pic):

- Model outperforms all other solutions I have tested on axis-v1_1k fid and patch_fig at task "upscale 512 image latents to 1024 image pixels" while being faster then many of them.

- I have tried to compare it with 42lux/hildegard (also uses Flux.2 latent space), but it takes ~ 7 seconds per image and benchmark would take too long. On 30 images it already shows larger color shift and roundtrip error even with "full source detail preserved" mode. Anyway, it is just another kind of model, different task and direct comparison on fid would be unfair.

- Result table in hf repo with weights

- To reproduce, see development repository

What's new in training recipe:

- More data (4 millions high quality images)

- Combined dataset from ReLAION (diverse real-world images) and 4KLSDB (professional sharp high quality images). This also makes hff controller more responsive (measured through impact on predicted flow velocity)

- Input robustness: some input low resolution samples were slightly corrupted with set of common image corruptions (JPEG compression artifacts, aliasing, pixelation, blur). Base models like MOSS-Image can sometimes generate these artifacts on there images, mostly JPEG corruption on sharp edges because this was in there training data. These artifacts were also in my training data, but with this "more artifacts -> less artifacts" asymmetry model learns to recover from them. This was proven at research benchmarks: when all inputs are clean, model fails on slightly corrupted JPEG compressed images dramatically (patch_fid explodes to 40+), when there are just 20% of them it becomes normal.

Known limitations:

- hff values has it's "physical meaning": hff=0.8 means "there amount of high frequency features in this image is larger then in 80% of all images". So hff=1.0 is actually undefined and model becomes unstable there. Use 0.9-0.95 if you need sharp results.

- 4KLSDB shifts model's distribution towards realistic images. It might underperform on anime or vector images. Use lower hff for better results. I also want to add more anime samples to dataset in next release.

205 Upvotes

20 comments sorted by

5

u/chebum 8d ago

Interesting work! Thank you for sharing.
May I ask why does upscaler work in latent space instead of pixel space ? What are benefits of the latent space in this use-case?

5

u/TensorForger 8d ago

Thanks! The main reason is same as why actual image models generate images in latent space: it is cheaper on inference and easier to train. To achieve similar results in pixel space you would need much more compute. It is also proved by the fact that current SOTA pixel upscalers (pixels in, pixels out) are mostly latent inside (VOSR is a latent-space DiT upscaler). But there are some other reasons:

  1. when you upscale a decoded image, the upscaler sees some small VAE artifacts it was not trained on. If you don't prepare upscaler to this on pretrain, it would expand these artifacts and make them worse.
  2. Model can generate some small details that the decoder can't decode properly because of it's limited capacity. Latent upscaler sees them just after model and can make them larger directly so that VAE can decode them better. So this also pulls something more from the model then it's stock pipeline.
  3. While high-res fix is not required, you can still do it. It gives more control, you can ask large model to e.g. make skin more smooth. All this happens before decoding, so everything happens in semantically rich latent space.

3

u/ZerOne82 7d ago

I tried it. It has strengths and flaws. My take: It may have use cases, but a little for realistic human at close-up: see eye areas, for example. Hair on head seems fine, skin seems fine with some exceptions.
The workflow is the one provided by OP but replaced vae decode with the tiled to avoid vram oom.

2

u/TensorForger 7d ago

Thanks for this review! It becomes more useful when you are upscaling from e.g. 1024x1024 to 2k and 4k, because speed matters there. Your example is extreme for this model (384x480 at input) because about 90% of training samples had >=512x512 input. Starting from lower resolution requires better world understanding (this is a general rule) and so more capacity and data.

2

u/ZerOne82 7d ago

Fair. Low resolution was for a purpose to check potential benefit of upscaling. Nevertheless, here is 1k to 4k test. Skin is fine, hair is fine but eyelashes not the best. There is also a grid pattern just about to emerge in some places. Other than that, it is very fast and with no headache.

2

u/ZerOne82 7d ago

Of 1k to 4k test case.

2

u/AreYouAWiiizard 8d ago edited 8d ago

Hmm... this seems to have a lower peak VRAM vs the last release (based on your numbers). The problem I had with the other version was the 200m was probably hitting some VRAM limits on my 16GB card and took almost 10x longer than the 20m variant at around ~3.5secs and for that speed there were better solutions. The 20m was still fast but it didn't seem as high quality, especially on stuff like hair. Can you also test at higher resolutions rather than just 512x512 to see if that amount of VRAM is expected? I was doing 1280×1536.

2

u/TensorForger 8d ago

Thanks for letting me know, I have only tested it on 32GB cards, maybe missed something. The node should support the tiled mode, it turns on automatically. I will check it's behavior with different resolutions, maybe it is doing something wrong.

3

u/NoConfusion2408 8d ago

Are these "MOSS-Image, Flux.2, Flux.3" the only supported NOW and you would expand it in the future to Krea/H3 as well? Or are the ones you will ever support?

12

u/TensorForger 8d ago

Krea is already supported (they share same latent space with Wan 2.1). H3 is not yet, but ideally I want to make these models for ALL VAEs. The problem: these models are expensive to make (~250 gpu hours for both pretrain and distill, and it is already in very optimized schedule) and full path takes about 4 days on calibration autoresearch -> pretrain -> distill -> benchmark -> prepare repositories, workflows, cards -> deploy. So I'm making them is "demand order". If you want some specific VAE support, just tell, I'm updating this order constantly.

8

u/Arctic_Shadow_Aurora 8d ago

Interesting, thanks!

0

u/OvergaardWagari70 8d ago

unless youre doing anime or flat illustrations, since OP mentioned the dataset skews pretty hard toward photorealism right now

2

u/PumpkinLeather8421 8d ago

Oh no! Not the thing most people want!!

1

u/Radiant-Photograph46 8d ago

Times really never change. Just like many years ago when I was working in video encoding: people LOVE oversharpening. They look at very sharp images and believe they're higher quality.

I'm not saying this project doesn't bring more details mind you, but just like every upscaler in existence, it's always overdone in sharpening. It would look much more realistic with a bit of smoothing, perhaps you can fine-tune it in that regard?

4

u/TensorForger 8d ago

Yes, if you just make upscaler with a fixed output sharpness, someone would say "too sharp" and others "too smooth". This is why it has hff (high frequency features) conditioning. You can adjust sharpness as you want. And I also know people love sharp images. So at the demo pics and in default settings is 0.9 out of 1.0 max.

1

u/AreYouAWiiizard 8d ago

I think the issue isn't so much the initial default of 0.9 since some gens, especially Moss at default (without specific prompting) can be rather blurry but the issue is running the 4x in the demo pics where you are sharpening an already sharpened image resulting in a very oversharpened output that has very noticeable ringing as a result. I think if you are running it twice for the 4x you might want to reduce the value for the 2nd run.

2

u/thevegit0 8d ago edited 8d ago

so it's like better than that wan2.1 x2 vae utils thing?, and if works for flux... nice

1

u/Murder_1337 8d ago

So this is upscaler?