Flux followup by yiyixuxu · Pull Request #9074 · huggingface/diffusers (original) (raw)

flux unit test for rotary embedding refactor

import torch from diffusers import FluxPipeline

model_path = "black-forest-labs/FLUX.1-dev" pipe = FluxPipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power

prompt = "A cat holding a sign that says hello world"

image = pipe( prompt, height=1024, width=1024, guidance_scale=3.5, num_inference_steps=50, max_sequence_length=512, generator=torch.Generator("cpu").manual_seed(0), ).images[0]

image.save(f"yiyi_test_4_out{branch}.png")