Instructions to use rmusr/sd-3.5-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use rmusr/sd-3.5-nf4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("rmusr/sd-3.5-nf4", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Stable Diffusion 3.5 NF4 checkpoint
How to use
from diffusers import SD3Transformer2DModel, AutoencoderKL
from transformers import T5EncoderModel, CLIPTextModelWithProjection
model_id = "stabilityai/stable-diffusion-3.5-medium" # or "large" or "large-turbo"
ckpt_nf4_id = "rmusr/sd-3.5-nf4"
text_encoder_3_nf4 = T5EncoderModel.from_pretrained(
ckpt_nf4_id, subfolder="text_encoder_3", torch_dtype=torch.float16
)
transformer_nf4 = SD3Transformer2DModel.from_pretrained(
ckpt_nf4_id, subfolder="transformer-medium", torch_dtype=torch.float16
)
# you can also load nf4 checkpoint of text_encoder, text_encoder_2, vae
pipeline = StableDiffusion3Pipeline.from_pretrained(
model_id,
text_encoder_3=text_encoder_3_nf4,
transformer=transformer_nf4,
torch_dtype=torch.float16,
).to("cuda")
pipeline.enable_attention_slicing()
License
The original model is released under the Stability AI Community License
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support