Instructions to use OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
FLUX 3 Image Klein SDNQ INT4
Left: original bf16 路 Right: this INT4 model (same prompt and seed).
This is a dynamic 4-bit quantized version of black-forest-labs/flux-3-image-klein using SDNQ. Both the transformer and the Qwen3-VL text encoder are quantized; the VAE stays in bf16.
Note: You need SDNQ v0.2.8 or superior and a diffusers version with FLUX 3 support.
Note: FLUX 3 Image Klein needs full scene captions. The example below skips the pipeline's prompt upsampler step, so pass a caption from the prompt upsampler, from another LLM using its system_prompts.json, or one written following the prompting guidelines.
Usage
You can find ready-to-use scripts in the diffusers-recipes repository.
FLUX 3 Image Klein runs as a Modular Diffusers pipeline. Import sdnq before loading so the quantized weights are registered. The whole pipeline fits on one GPU: the sample below peaked at 11.5 GiB of VRAM at 2048x1152.
For prompting, the bounding box layout format and image editing, see the original model card.
Sample image
The INT4 image above was generated with the following prompt and settings (seed 7):
import sdnq # noqa: F401
import torch
from diffusers import ModularPipeline
blocks = ModularPipeline.from_pretrained("OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit").blocks
blocks.sub_blocks.pop("prompt_upsampler")
pipe = blocks.init_pipeline("OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit")
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
prompt = r"""A cinematic film still of the inside of a small neighborhood pet shop, shot on an ARRI Alexa Mini LF with a Cooke S4 32mm lens at T2.8, 180-degree shutter, camera at eye level on a dolly, wide 16:9 frame. Late-afternoon sunlight comes in low through the front window on the right in hard shafts with dust in the air, and the rest of the shop is lit by practical tungsten ceiling lamps, leaving the corners in shadow. Shallow depth of field, the back wall slightly out of focus, visible film grain, subtle halation around the window highlights. A dark green painted wooden sign <sign_1> with chipped paint hangs high on the back wall under a small brass picture lamp and reads "WHISKERS & WAGS". On a shelf at the left, an adult tabby cat <cat_1> lies next to bags of pet food. In the left foreground, an adult golden retriever <dog_1>, the biggest animal in the shop, sits in a large wicker basket and looks toward the window. In the center, a chalkboard easel <chalkboard_1> reads "ADOPT A FRIEND TODAY" in white chalk. On the right, a scarlet macaw <parrot_1> with a red head and body and blue and yellow wings perches on a wooden stand above a lit aquarium <aquarium_1> with small orange and blue fish. On the floor in a patch of sunlight, an adult white dwarf rabbit <rabbit_1>, smaller than the cat, nibbles a carrot on scuffed checkered tiles. The shelves hold pet toys, leashes and food bags <background_1>. [{"id": "background_1", "bbox": [0, 0, 1000, 1000], "desc": "A pet shop interior with scuffed wooden shelves of pet toys, leashes and food bags, a checkered tile floor, low sunlight through the front window on the right and tungsten ceiling lamps, shadowed corners."}, {"id": "sign_1", "bbox": [40, 300, 150, 700], "desc": "A dark green painted wooden sign with chipped edges, lit from above by a small brass picture lamp, with the text \"WHISKERS & WAGS\" in cream serif letters."}, {"id": "cat_1", "bbox": [290, 50, 440, 230], "desc": "An adult tabby cat lying on a wooden shelf next to bags of pet food."}, {"id": "dog_1", "bbox": [480, 80, 960, 340], "desc": "An adult golden retriever sitting in a large round wicker basket, looking toward the window, the biggest animal in the scene."}, {"id": "chalkboard_1", "bbox": [520, 420, 930, 560], "desc": "A wooden chalkboard easel with \"ADOPT A FRIEND TODAY\" handwritten in white chalk."}, {"id": "parrot_1", "bbox": [180, 760, 440, 870], "desc": "A scarlet macaw with a red head and body and blue and yellow wings, perched on a wooden stand."}, {"id": "aquarium_1", "bbox": [450, 650, 700, 900], "desc": "A lit glass aquarium with green plants and small orange and blue fish."}, {"id": "rabbit_1", "bbox": [850, 620, 960, 700], "desc": "An adult white dwarf rabbit, smaller than the cat, nibbling an orange carrot on the floor in a patch of sunlight."}]"""
image = pipe(
prompt=prompt,
height=1152,
width=2048,
generator=torch.Generator().manual_seed(7),
output="images",
)[0]
image.save("flux3_klein_int4.png")
License
This model is released under the FLUX Kommunity License v.1.0, the same as the original. The Qwen3-VL-4B-Instruct text encoder is under Apache-2.0.
- Downloads last month
- 125
Model tree for OzzyGT/Flux_3_Image_Klein_sdnq_dynamic_4bit
Base model
black-forest-labs/flux-3-image-klein
