Instructions to use HighCWu/FLUX.1-dev-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use HighCWu/FLUX.1-dev-4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("HighCWu/FLUX.1-dev-4bit", 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
Img2img works with this
#4
by APIS-AI - opened
This comment has been hidden
Ok, img2img works with this now.
from diffusers import FluxImg2ImgPipeline
flux_img2img = FluxImg2ImgPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev",
transformer=None,
text_encoder_2=None,
torch_dtype=torch.bfloat16,
use_safetensors=True,
)
flux_img2img.text_encoder_2 = text_encoder_2
flux_img2img.transformer = transformer
APIS-AI changed discussion title from Would like to see quantized controlnet as well for flux img2img to Img2img works with this