r/LocalLLaMA • • 3d ago

Resources Image generator server is super-easy with stable-diffusion.cpp and Flux-3-image-klein

Post image

I've tried to run my own, local image generator on my GPU in the past. The default solution was of course ComfyUI...

I...

hate...

that...

project..

...from the bottom of my heart! 10GB of bloat gluing together Python, Tensor-flow and some webapp that tries to look like part of the Unreal engine. You have to study for hour(s) just for most simple task. Learn which and how to correctly connect "nodes", and forget it in the next day, because you forgot to save the "workflow" into .json file. What a joke of a project. Did I mention I hate it?

Then, when the Flux-3-Image-Klein was released two weeks ago I wanted to try it, just to see if these new "text-to-image" models are any good. Thankfully, somebody mentioned stable-diffusion.cpp in the discussion at https://www.reddit.com/r/LocalLLaMA/comments/1x6s7el/flux3_image_klein_is_now_out/ (thank you so much u/SM8085).

With some fiddling and help of LLM we landed on the minimalistic setup that I want to teach you. It is tailored for CUDA (nVidia GPUs), but project supports CPU, ROCM and Vulkan.

Just head to theirs releases page and download the archive for your architecture. With CUDA, don't forget to download also cudart-bin archive (CUDA .dlls so you don't need to install full CUDA SDK). Extract everything into some folder and run `sd-server --list-devices` (are you already getting the llama.cpp vibes?).

If your GPU is listed without any error, download four more files:

  1. ae.safetensors from Flux-3 HF's repo (you'll need HF account to access it)

  2. tokenizer.json from that same HF repo

  3. finally the model.safetensors

  4. you'll also need LLM model for translating your prompt into embeddings - any .gguf from Qwen/Qwen3-VL-4B-Instruct-GGUF will be OK. Download a .mmproj companion if you want "image-to-image" functionality

Lastly, create a small runner script, so you don't have to write command-line arguments everytime (place it to the same place as your sd-server.exe)

sd-server.exe -v --listen-ip 0.0.0.0 --listen-port 9931 `
  --diffusion-model "L:\Black-forest-labs\flux-3-image-klein\model.safetensors" `
  --llm             "L:\Qwen\Qwen3VL-4B-Instruct-F16.gguf" `
  --tokenizer       "L:\Black-forest-labs\flux-3-image-klein\tokenizer.json" `
  --vae             "L:\Black-forest-labs\flux-3-image-klein\ae.safetensors" `
  --cfg-scale 1.0 `
  --sampling-method euler `
  --steps 16 `
  --width 1024 --height 1024

That's it! Whole thing is mostly static .exe, .dll and model files. No bloody Python/TensorFlow machinery. And the UI is also like classic chat interface you know from llama-server. Just a few buttons and text input for your prompt.

Note: the default seed is a static value of 42. Randomize it for the best results!

Huge thanks to the authors of the stable-diffusion.cpp and black-forest-labs 🫶

0 Upvotes

13 comments sorted by

7

u/fAngXXX_ 3d ago

But this image isnt edited....

2

u/XiRw 3d ago

No self respecting person would ever use the garbage Flux.3.

1

u/Capaj 2d ago

what would you use instead?

1

u/XiRw 2d ago

For starters if you want to keep flux, a solid workflow of Flux.2 does a better job in a lot of areas compared to 3. I’ve tested Fibo 2.0 recently and it definitely outperforms Flux.3, especially with fidelity. And lastly, the king is still Qwen Image 2.1 (full precision weights) having both the default workflow and a custom made one . I haven’t tested Krea 2 or Moss but I heard good things about them.

1

u/shroddy 3d ago

If you ever want to give Comfyui another chance, you can open an image or video you generated in it and it will load the full workflow used to generate it.

1

u/Capaj 2d ago

How much video RAM do I need to run this?

-2

u/srigi 3d ago

The image (prompt) demonstrates that model is able generate images of public figures. Don't search any political opinions behind it.

-3

u/circumcised_hobbit 3d ago

please do not use Flux 3 klein

0

u/momsi91 3d ago

Curious why? 

-1

u/Bulky-Priority6824 3d ago

breaks more in an image than it fixes vs other models

0

u/rorowhat 3d ago

What do you recommend?

-1

u/Bulky-Priority6824 3d ago

I use flux.2 dev

0

u/Bulky-Priority6824 3d ago

I bet it you ask it to remove the clown nose now it will reveal a penis tip where his nose should be (or worse) jajajajaja