How to use AlekseyCalvin/FLUX2_dev_2bit_hqq 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("AlekseyCalvin/FLUX2_dev_2bit_hqq", 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]
How to use AlekseyCalvin/FLUX2_dev_2bit_hqq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-to-image", model="AlekseyCalvin/FLUX2_dev_2bit_hqq")
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AlekseyCalvin/FLUX2_dev_2bit_hqq", dtype="auto")