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 Settings
- llama.cpp
How to use StableDiffusionVN/Flux with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -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 serve -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
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
- Atomic Chat new
- 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":109,"last_link_id":201,"nodes":[{"id":92,"type":"CheckpointLoaderSimple","pos":[4,34],"size":[315,98],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[201]},{"name":"CLIP","type":"CLIP","links":[174],"slot_index":1},{"name":"VAE","type":"VAE","links":[177,184]}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["Checkpoint/Flux_dev_v1_fill.safetensors"]},{"id":93,"type":"DifferentialDiffusion","pos":[346,34],"size":[316.79998779296875,26],"flags":{},"order":2,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":201}],"outputs":[{"name":"MODEL","type":"MODEL","links":[181],"slot_index":0}],"properties":{"Node name for S&R":"DifferentialDiffusion"},"widgets_values":[]},{"id":95,"type":"InpaintModelConditioning","pos":[774,34],"size":[345.5999755859375,138],"flags":{},"order":6,"mode":0,"inputs":[{"name":"positive","type":"CONDITIONING","link":188},{"name":"negative","type":"CONDITIONING","link":189},{"name":"vae","type":"VAE","link":177},{"name":"pixels","type":"IMAGE","link":187},{"name":"mask","type":"MASK","link":191}],"outputs":[{"name":"positive","type":"CONDITIONING","links":[178],"slot_index":0},{"name":"negative","type":"CONDITIONING","links":[179],"slot_index":1},{"name":"latent","type":"LATENT","links":[180],"slot_index":2}],"properties":{"Node name for S&R":"InpaintModelConditioning"},"widgets_values":[true]},{"id":96,"type":"CLIPTextEncode","pos":[344,108],"size":[400,200],"flags":{},"order":3,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":174}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[190],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["red hair, portrait men"]},{"id":97,"type":"KSampler","pos":[1148,33],"size":[315,474],"flags":{},"order":7,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":181},{"name":"positive","type":"CONDITIONING","link":178},{"name":"negative","type":"CONDITIONING","link":179},{"name":"latent_image","type":"LATENT","link":180}],"outputs":[{"name":"LATENT","type":"LATENT","links":[183],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[1033566858633089,"randomize",20,1,"euler","simple",1]},{"id":98,"type":"LoadImage","pos":[420,358],"size":[315,314],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[186],"slot_index":0},{"name":"MASK","type":"MASK","links":[191]}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["clipspace/clipspace-mask-3405815.3999999985.png [input]","image"]},{"id":99,"type":"VAEDecode","pos":[1484,32],"size":[210,46],"flags":{},"order":8,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":183},{"name":"vae","type":"VAE","link":184}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[185],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":100,"type":"SaveImage","pos":[1723,36],"size":[471,659],"flags":{},"order":9,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":185}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["ComfyUI"]},{"id":101,"type":"ConstrainImage|pysssss","pos":[775,360],"size":[315,154],"flags":{},"order":4,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":186}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[187],"slot_index":0,"shape":6}],"properties":{"Node name for S&R":"ConstrainImage|pysssss"},"widgets_values":[1280,1280,0,0,"no"]},{"id":102,"type":"FluxGuidance","pos":[776,219],"size":[339,58],"flags":{},"order":5,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":190}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[188,189],"slot_index":0}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[25]},{"id":109,"type":"Note","pos":[14,416],"size":[336,253],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{"text":""},"widgets_values":["Flux Fill\n\nComfyUI Colab:\n- Creator: stablediffusion.vn\n- Website: sdvn.me | comfy.vn | fluxai.vn\n- Sub Web: trainlora.vn | shakker.vn\n- Document: bit.ly/sdvn-lib\n- Skills training: hungdiffusion.com"],"color":"#432","bgcolor":"#653"}],"links":[[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"],[174,92,1,96,0,"CLIP"],[177,92,2,95,2,"VAE"],[178,95,0,97,1,"CONDITIONING"],[179,95,1,97,2,"CONDITIONING"],[180,95,2,97,3,"LATENT"],[181,93,0,97,0,"MODEL"],[183,97,0,99,0,"LATENT"],[184,92,2,99,1,"VAE"],[185,99,0,100,0,"IMAGE"],[186,98,0,101,0,"IMAGE"],[187,101,0,95,3,"IMAGE"],[188,102,0,95,0,"CONDITIONING"],[189,102,0,95,1,"CONDITIONING"],[190,96,0,102,0,"CONDITIONING"],[191,98,1,95,4,"MASK"],[201,92,0,93,0,"MODEL"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8033484162895932,"offset":[270.7365646858369,333.7132007397816]}},"version":0.4} |