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
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":14,"last_link_id":14,"nodes":[{"id":3,"type":"KSampler","pos":[865,208],"size":[319,506],"flags":{},"order":7,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":12},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":10},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[310136945749057,"randomize",20,1,"euler","simple",1]},{"id":4,"type":"CheckpointLoaderSimple","pos":[76,214],"size":[315,98],"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[11],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["Checkpoint/Flux_dev_v1-fp8.safetensors"]},{"id":5,"type":"EmptyLatentImage","pos":[522,608],"size":[315,106],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[1024,1024,1]},{"id":6,"type":"CLIPTextEncode","pos":[414,403],"size":[422.84503173828125,164.31304931640625],"flags":{},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4,10],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""]},{"id":8,"type":"VAEDecode","pos":[1211,210],"size":[210,46],"flags":{},"order":8,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":9,"type":"SaveImage","pos":[1510,208],"size":[378,506],"flags":{},"order":9,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["ComfyUI"]},{"id":11,"type":"ApplyIPAdapterFlux","pos":[463,211],"size":[374.4000244140625,146],"flags":{},"order":5,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":11},{"name":"ipadapter_flux","type":"IP_ADAPTER_FLUX_INSTANTX","link":13},{"name":"image","type":"IMAGE","link":14}],"outputs":[{"name":"MODEL","type":"MODEL","links":[12],"slot_index":0}],"properties":{"Node name for S&R":"ApplyIPAdapterFlux"},"widgets_values":[1,0,1]},{"id":12,"type":"IPAdapterFluxLoader","pos":[477,58],"size":[360,106],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"ipadapterFlux","type":"IP_ADAPTER_FLUX_INSTANTX","links":[13]}],"properties":{"Node name for S&R":"IPAdapterFluxLoader"},"widgets_values":["ip-adapter.bin","google/siglip-so400m-patch14-384","cuda"]},{"id":13,"type":"LoadImage","pos":[78,360],"size":[321,354],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[14]},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["Art_wall.jpeg","image"]},{"id":14,"type":"Note","pos":[1202,463],"size":[290,251],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[],"properties":{"text":""},"widgets_values":["Flux Instant IPAdapter\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":[[2,5,0,3,3,"LATENT"],[3,4,1,6,0,"CLIP"],[4,6,0,3,1,"CONDITIONING"],[7,3,0,8,0,"LATENT"],[8,4,2,8,1,"VAE"],[9,8,0,9,0,"IMAGE"],[10,6,0,3,2,"CONDITIONING"],[11,4,0,11,0,"MODEL"],[12,11,0,3,0,"MODEL"],[13,12,0,11,1,"IP_ADAPTER_FLUX_INSTANTX"],[14,13,0,11,2,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8264462809917354,"offset":[432.83723730128696,263.66125714496087]}},"version":0.4} |