r/StableDiffusion • • 2d ago

Resource - Update Dflow-2B - an indie text-to-image model, trained from scratch on a single GPU, mostly on photographs and classical art.

Post image

Model: https://huggingface.co/data-archetype/dflow_2b
For Mac: https://huggingface.co/ungurenko/dflow-2b-mlx

Text encoder: T5Gemma 2 270M
Vae: dinac3_96
ComfyUI nodes: https://huggingface.co/data-archetype/dflow_2b/tree/main/comfyui

dflow_2b is an indie text-to-image model, trained from scratch on a single GPU, mostly on photographs and classical art. Its denoiser has 2.1 billion parameters. It reads natural-language prompts and structured JSON layout prompts. It takes ordinary captions and JSON layout captions. The layout format is close to MOSS-Image's, and MOSS-Image layouts are converted internally.

124 Upvotes

25 comments sorted by

4

u/Bigbagdaddy9x19 2d ago

from scratch on one gpu is nuts. how long was the training run start to finish? asking so i can estimate how many months my electric bill would cry

5

u/sareewala 2d ago

I am not the author , but found it very interesting. The author of the model is active on lodestone's discord and more details will be there for sure.

1

u/COMPLOGICGADH 2d ago

What's the username on discord of the author

5

u/quantiler 2d ago

Hey I'm the author, happy to answer here :)

4

u/COMPLOGICGADH 2d ago

I came to know your username after some searching keep it up i tested your model and for a 2b model it's really great!

3

u/quantiler 2d ago

Thanks !

1

u/Apprehensive_Sky892 1d ago

What kind of GPU did you use for training, and how long did it take?

2

u/quantiler 1d ago

GH200 and about 800 hours so far. A 5090 and anything in between would work too but take longer.

1

u/Apprehensive_Sky892 1d ago

Thanks! Assuming it cost around $2.50 to $3/hour to rent a GH200, that would be around $2000 to $2400, which is pretty cheap for a trained from scratch model!

Of course there is the labor cost too 😅

3

u/quantiler 2d ago

I share a lot of details including training time in the model's technical report https://huggingface.co/data-archetype/dflow_2b/blob/main/TECHNICAL_REPORT.md

latest version has ballpark 800 GH200 hours of training.

1

u/Bigbagdaddy9x19 1d ago

oh nice, didnt expect the author to show up. 800 gh200 hours is way more than i pictured, reading the report now

8

u/Astral-Lemmons 2d ago

Super cool.

Willing to opensource your training setup?

if not - do you have a guide to doing this "from scratch" training? I'd like to try my hand at making my own model as well.

5

u/quantiler 2d ago

I don't intend to release the training code itself because it's somewhat sprawling with tons and tons of experiments and I don't really want to support that. However the technical report contain sufficiently detailed information that Claude / Codex / Gemini should be able to reproduce it without too much trouble.
The secret sauce is at least as much the dataset and the VAE though ( of which I am also the author ). I share significant chunks of the dataset on my HF too, and complementing it with e.g GPIC should be more than enough to train a model.

2

u/Astral-Lemmons 1d ago

cool. thanks for the lead. I already pointed chatgpt at your repo and it understood.

I want to try my hand at training a hyper specific niche model instead of a general use model to see if it's useful for very focussed tasks

3

u/suspicious_Jackfruit 1d ago

I think generally you'd be better off (from a result's perspective) using a generalised pretrained base model and then finetuning that to leverage it's vast existing understanding and knowledge of either what you're focusing on or adjacent to it. But where's the fun in that eh?

1

u/Ill-Ant3861 2d ago

can share workflow?

2

u/sareewala 2d ago

workflows are in the repo https://huggingface.co/data-archetype/dflow_2b/tree/main/comfyui/workflows though you will need the custom nodes too as mentioned in the repo by the author.

2

u/chebum 2d ago

That’s extremely impressive! Thanks for sharing!

2

u/TensorForger 2d ago

This is so impressive that 3 years ago you would need a datacenter scale and probably hundreds of thousands dollars to train a model with similar quality, now it can be done on a single GPU and called an "indie" model

2

u/quantiler 1d ago

I've just released v0.3 which has some decent improvements in consistency and quality, would recommend updating to the latest version, and using the included workflow templates / or the gallery images as starting points, using the correct sampler setings makes a big difference.

2

u/vramkickedin 1d ago

Its got sovl

1

u/quantiler 1d ago

The latest version v0.31 now includes a int8 convrot checkpoint compatible with ComfyUI's embedded kernels, as well as native apple silicon support ( including a Metal kernel for M5 int8 ).

1

u/Version-Strong 2d ago

It has a 1.5 aesthetic(which is to be expected), but that's bloody impressive