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":83,"last_link_id":127,"nodes":[{"id":71,"type":"CLIPVisionEncode","pos":[695,371],"size":[432.5999755859375,46],"flags":{},"order":5,"mode":0,"inputs":[{"name":"clip_vision","type":"CLIP_VISION","link":115},{"name":"image","type":"IMAGE","link":116}],"outputs":[{"name":"CLIP_VISION_OUTPUT","type":"CLIP_VISION_OUTPUT","links":[117],"slot_index":0}],"properties":{"Node name for S&R":"CLIPVisionEncode"},"widgets_values":[]},{"id":72,"type":"CLIPVisionLoader","pos":[352,371],"size":[315,58],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"CLIP_VISION","type":"CLIP_VISION","links":[115]}],"properties":{"Node name for S&R":"CLIPVisionLoader"},"widgets_values":["siglip-so400m-patch14-384.safetensors"]},{"id":73,"type":"LoadImage","pos":[350,479],"size":[315,314],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[116]},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["Art_wall.jpeg","image"]},{"id":74,"type":"StyleModelApply","pos":[1163,371],"size":[447,66],"flags":{},"order":7,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":120},{"name":"style_model","type":"STYLE_MODEL","link":118},{"name":"clip_vision_output","type":"CLIP_VISION_OUTPUT","link":117}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[121,122],"slot_index":0}],"properties":{"Node name for S&R":"StyleModelApply"},"widgets_values":[]},{"id":75,"type":"StyleModelLoader","pos":[812,468],"size":[315,58],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"STYLE_MODEL","type":"STYLE_MODEL","links":[118]}],"properties":{"Node name for S&R":"StyleModelLoader"},"widgets_values":["flux1-redux-dev.safetensors"]},{"id":76,"type":"CheckpointLoaderSimple","pos":[812,571],"size":[315,98],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[127],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[119],"slot_index":1},{"name":"VAE","type":"VAE","links":[126]}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["Checkpoint/Flux_dev_v1-fp8.safetensors"]},{"id":77,"type":"CLIPTextEncode","pos":[1167,513],"size":[443,182],"flags":{},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":119}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[120],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""]},{"id":78,"type":"KSampler","pos":[1633,371],"size":[327,488],"flags":{},"order":8,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":127},{"name":"positive","type":"CONDITIONING","link":121},{"name":"negative","type":"CONDITIONING","link":122},{"name":"latent_image","type":"LATENT","link":123}],"outputs":[{"name":"LATENT","type":"LATENT","links":[124],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[800893977503502,"randomize",20,1,"euler","simple",1]},{"id":79,"type":"EmptyLatentImage","pos":[1290,766],"size":[315,106],"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[123]}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[1024,1024,1]},{"id":80,"type":"VAEDecode","pos":[1978,371],"size":[210,46],"flags":{},"order":9,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":124},{"name":"vae","type":"VAE","link":126}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[125],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":81,"type":"SaveImage","pos":[2218.828369140625,371],"size":[391,485],"flags":{},"order":10,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":125}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["ComfyUI"]},{"id":83,"type":"Note","pos":[814,741],"size":[336,126],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{"text":""},"widgets_values":["Flux Redux\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"],[115,72,0,71,0,"CLIP_VISION"],[116,73,0,71,1,"IMAGE"],[117,71,0,74,2,"CLIP_VISION_OUTPUT"],[118,75,0,74,1,"STYLE_MODEL"],[119,76,1,77,0,"CLIP"],[120,77,0,74,0,"CONDITIONING"],[121,74,0,78,1,"CONDITIONING"],[122,74,0,78,2,"CONDITIONING"],[123,79,0,78,3,"LATENT"],[124,78,0,80,0,"LATENT"],[125,80,0,81,0,"IMAGE"],[126,76,2,80,1,"VAE"],[127,76,0,78,0,"MODEL"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7060367454068242,"offset":[42.26144284386624,109.5583323652417]}},"version":0.4} |