Instructions to use StableDiffusionVN/Flux with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use StableDiffusionVN/Flux with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="StableDiffusionVN/Flux", filename="Clip/t5-v1_1-xxl-encoder-Q4_K_S.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use StableDiffusionVN/Flux with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf StableDiffusionVN/Flux:Q4_K_S # Run inference directly in the terminal: llama-cli -hf StableDiffusionVN/Flux:Q4_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf StableDiffusionVN/Flux:Q4_K_S # Run inference directly in the terminal: llama-cli -hf StableDiffusionVN/Flux:Q4_K_S
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf StableDiffusionVN/Flux:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf StableDiffusionVN/Flux:Q4_K_S
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf StableDiffusionVN/Flux:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf StableDiffusionVN/Flux:Q4_K_S
Use Docker
docker model run hf.co/StableDiffusionVN/Flux:Q4_K_S
- LM Studio
- Jan
- Ollama
How to use StableDiffusionVN/Flux with Ollama:
ollama run hf.co/StableDiffusionVN/Flux:Q4_K_S
- Unsloth Studio new
How to use StableDiffusionVN/Flux with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for StableDiffusionVN/Flux to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for StableDiffusionVN/Flux to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for StableDiffusionVN/Flux to start chatting
- Docker Model Runner
How to use StableDiffusionVN/Flux with Docker Model Runner:
docker model run hf.co/StableDiffusionVN/Flux:Q4_K_S
- Lemonade
How to use StableDiffusionVN/Flux with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull StableDiffusionVN/Flux:Q4_K_S
Run and chat with the model
lemonade run user.Flux-Q4_K_S
List all available models
lemonade list
| { | |
| "last_node_id": 69, | |
| "last_link_id": 114, | |
| "nodes": [ | |
| { | |
| "id": 8, | |
| "type": "VAEDecode", | |
| "pos": [ | |
| 1178, | |
| 91 | |
| ], | |
| "size": { | |
| "0": 210, | |
| "1": 46 | |
| }, | |
| "flags": {}, | |
| "order": 5, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "samples", | |
| "type": "LATENT", | |
| "link": 66 | |
| }, | |
| { | |
| "name": "vae", | |
| "type": "VAE", | |
| "link": 88 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "IMAGE", | |
| "type": "IMAGE", | |
| "links": [ | |
| 9 | |
| ], | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "VAEDecode" | |
| } | |
| }, | |
| { | |
| "id": 9, | |
| "type": "SaveImage", | |
| "pos": [ | |
| 1422, | |
| 88 | |
| ], | |
| "size": { | |
| "0": 356.08502197265625, | |
| "1": 499.8143310546875 | |
| }, | |
| "flags": {}, | |
| "order": 6, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "images", | |
| "type": "IMAGE", | |
| "link": 9 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "SaveImage" | |
| }, | |
| "widgets_values": [ | |
| "ComfyUI" | |
| ] | |
| }, | |
| { | |
| "id": 69, | |
| "type": "CLIPTextEncode", | |
| "pos": [ | |
| 408, | |
| 89 | |
| ], | |
| "size": { | |
| "0": 400, | |
| "1": 200 | |
| }, | |
| "flags": {}, | |
| "order": 3, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "clip", | |
| "type": "CLIP", | |
| "link": 111 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "CONDITIONING", | |
| "type": "CONDITIONING", | |
| "links": [ | |
| 112, | |
| 114 | |
| ], | |
| "shape": 3 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| "Actual image of a smiling Vietnamese girl. With both hands she was holding a notice board with the word \"FluxAI by SDVN.ME\" large in the middle. Photos have high detail" | |
| ] | |
| }, | |
| { | |
| "id": 53, | |
| "type": "EmptyLatentImage", | |
| "pos": [ | |
| 499, | |
| 347 | |
| ], | |
| "size": { | |
| "0": 303.3410339355469, | |
| "1": 111.14437103271484 | |
| }, | |
| "flags": {}, | |
| "order": 0, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 85 | |
| ], | |
| "shape": 3 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "EmptyLatentImage" | |
| }, | |
| "widgets_values": [ | |
| 512, | |
| 512, | |
| 1 | |
| ] | |
| }, | |
| { | |
| "id": 68, | |
| "type": "Note", | |
| "pos": [ | |
| 65, | |
| 237 | |
| ], | |
| "size": { | |
| "0": 312.59844970703125, | |
| "1": 99.95023345947266 | |
| }, | |
| "flags": {}, | |
| "order": 1, | |
| "mode": 0, | |
| "properties": { | |
| "text": "" | |
| }, | |
| "widgets_values": [ | |
| "ComfyUI Colab:\n- Creator: stablediffusion.vn\n- Website: sdvn.me | comfy.vn | fluxai.vn\n- Document: bit.ly/sdvn-lib\n- Skills training: hungdiffusion.com" | |
| ], | |
| "color": "#432", | |
| "bgcolor": "#653" | |
| }, | |
| { | |
| "id": 52, | |
| "type": "CheckpointLoaderSimple", | |
| "pos": [ | |
| 63, | |
| 89 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 98 | |
| }, | |
| "flags": {}, | |
| "order": 2, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "MODEL", | |
| "type": "MODEL", | |
| "links": [ | |
| 89 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| }, | |
| { | |
| "name": "CLIP", | |
| "type": "CLIP", | |
| "links": [ | |
| 111 | |
| ], | |
| "shape": 3, | |
| "slot_index": 1 | |
| }, | |
| { | |
| "name": "VAE", | |
| "type": "VAE", | |
| "links": [ | |
| 88 | |
| ], | |
| "shape": 3, | |
| "slot_index": 2 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CheckpointLoaderSimple" | |
| }, | |
| "widgets_values": [ | |
| "Flux_schnell_v1-fp8.safetensors" | |
| ] | |
| }, | |
| { | |
| "id": 44, | |
| "type": "KSampler", | |
| "pos": [ | |
| 837, | |
| 93 | |
| ], | |
| "size": { | |
| "0": 318.3961181640625, | |
| "1": 487.5167236328125 | |
| }, | |
| "flags": {}, | |
| "order": 4, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "model", | |
| "type": "MODEL", | |
| "link": 89 | |
| }, | |
| { | |
| "name": "positive", | |
| "type": "CONDITIONING", | |
| "link": 112 | |
| }, | |
| { | |
| "name": "negative", | |
| "type": "CONDITIONING", | |
| "link": 114 | |
| }, | |
| { | |
| "name": "latent_image", | |
| "type": "LATENT", | |
| "link": 85, | |
| "slot_index": 3 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 66 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "KSampler" | |
| }, | |
| "widgets_values": [ | |
| 1, | |
| "fixed", | |
| 4, | |
| 1, | |
| "euler", | |
| "simple", | |
| 1 | |
| ] | |
| } | |
| ], | |
| "links": [ | |
| [ | |
| 9, | |
| 8, | |
| 0, | |
| 9, | |
| 0, | |
| "IMAGE" | |
| ], | |
| [ | |
| 66, | |
| 44, | |
| 0, | |
| 8, | |
| 0, | |
| "LATENT" | |
| ], | |
| [ | |
| 75, | |
| 10, | |
| 0, | |
| 8, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 76, | |
| 12, | |
| 0, | |
| 44, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 77, | |
| 11, | |
| 0, | |
| 48, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 78, | |
| 10, | |
| 0, | |
| 30, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 79, | |
| 12, | |
| 0, | |
| 51, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 80, | |
| 11, | |
| 0, | |
| 51, | |
| 1, | |
| "CLIP" | |
| ], | |
| [ | |
| 81, | |
| 10, | |
| 0, | |
| 51, | |
| 2, | |
| "VAE" | |
| ], | |
| [ | |
| 85, | |
| 53, | |
| 0, | |
| 44, | |
| 3, | |
| "LATENT" | |
| ], | |
| [ | |
| 88, | |
| 52, | |
| 2, | |
| 8, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 89, | |
| 52, | |
| 0, | |
| 44, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 111, | |
| 52, | |
| 1, | |
| 69, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 112, | |
| 69, | |
| 0, | |
| 44, | |
| 1, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 114, | |
| 69, | |
| 0, | |
| 44, | |
| 2, | |
| "CONDITIONING" | |
| ] | |
| ], | |
| "groups": [], | |
| "config": {}, | |
| "extra": { | |
| "ds": { | |
| "scale": 1.331000000000001, | |
| "offset": [ | |
| -70.43711732987452, | |
| 13.751635799046973 | |
| ] | |
| } | |
| }, | |
| "version": 0.4 | |
| } |