Views
No views yet
| Quantization | OpenAI CLIP ViT-L/14 Quantization | OpenCLIP ViT-G/14 Quantization | Google T5-xxl Quantization | VAE Quantization |
|---|---|---|---|---|
| FP16 | FP16 | FP16 | FP16 | FP16 |
| Q8_0 | FP16 | FP16 | Q8_0 | FP16 |
| (pure) Q8_0 | Q8_0 | Q8_0 | Q8_0 | FP16 |
| Q4_1 | FP16 | FP16 | Q8_0 | FP16 |
| Q4_0 | FP16 | FP16 | Q8_0 | FP16 |
| (pure) Q4_0 | Q4_0 | Q4_0 | Q4_0 | FP16 |


1├── text_encoders/ (text_encoder/text_encoder_1/text_encoder_2 are for diffusers)
2│ ├── README.md
3│ ├── clip_g.safetensors
4│ ├── clip_l.safetensors
5│ ├── t5xxl_fp16.safetensors
6│ └── t5xxl_fp8_e4m3fn.safetensors
7│
8├── README.md
9├── LICENSE
10├── sd3_large_turbo.safetensors
11├── SD3.5L_Turbo_example_workflow.json
12└── sd3_large_turbo_demo.png
13
14** File structure below is for diffusers integration**
15├── scheduler/
16├── text_encoder/
17├── text_encoder_2/
18├── text_encoder_3/
19├── tokenizer/
20├── tokenizer_2/
21├── tokenizer_3/
22├── transformer/
23├── vae/
24└── model_index.json
25pip install -U diffusers1import torch
2from diffusers import StableDiffusion3Pipeline
3
4pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large-turbo", torch_dtype=torch.bfloat16)
5pipe = pipe.to("cuda")
6
7image = pipe(
8 "A capybara holding a sign that reads Hello Fast World",
9 num_inference_steps=4,
10 guidance_scale=0.0,
11).images[0]
12image.save("capybara.png")pip install bitsandbytes1from diffusers import BitsAndBytesConfig, SD3Transformer2DModel
2from diffusers import StableDiffusion3Pipeline
3import torch
4
5model_id = "stabilityai/stable-diffusion-3.5-large-turbo"
6
7nf4_config = BitsAndBytesConfig(
8 load_in_4bit=True,
9 bnb_4bit_quant_type="nf4",
10 bnb_4bit_compute_dtype=torch.bfloat16
11)
12model_nf4 = SD3Transformer2DModel.from_pretrained(
13 model_id,
14 subfolder="transformer",
15 quantization_config=nf4_config,
16 torch_dtype=torch.bfloat16
17)
18
19t5_nf4 = T5EncoderModel.from_pretrained("diffusers/t5-nf4", torch_dtype=torch.bfloat16)
20
21pipeline = StableDiffusion3Pipeline.from_pretrained(
22 model_id,
23 transformer=model_nf4,
24 text_encoder_3=t5_nf4,
25 torch_dtype=torch.bfloat16
26)
27pipeline.enable_model_cpu_offload()
28
29prompt = "A whimsical and creative image depicting a hybrid creature that is a mix of a waffle and a hippopotamus, basking in a river of melted butter amidst a breakfast-themed landscape. It features the distinctive, bulky body shape of a hippo. However, instead of the usual grey skin, the creature's body resembles a golden-brown, crispy waffle fresh off the griddle. The skin is textured with the familiar grid pattern of a waffle, each square filled with a glistening sheen of syrup. The environment combines the natural habitat of a hippo with elements of a breakfast table setting, a river of warm, melted butter, with oversized utensils or plates peeking out from the lush, pancake-like foliage in the background, a towering pepper mill standing in for a tree. As the sun rises in this fantastical world, it casts a warm, buttery glow over the scene. The creature, content in its butter river, lets out a yawn. Nearby, a flock of birds take flight"
30
31image = pipeline(
32 prompt=prompt,
33 num_inference_steps=4,
34 guidance_scale=0.0,
35 max_sequence_length=512,
36).images[0]
37image.save("whimsical.png")