Views
No views yet
1import torch
2from diffusers import FluxTransformer2DModel
3from pipeline_flux_de_distill import FluxPipeline
4
5model_path = "black-forest-labs/FLUX.1-dev"
6
7transformer = FluxTransformer2DModel.from_pretrained(
8 "InstantX/flux-dev-de-distill-diffusers",
9 torch_dtype=torch.bfloat16
10)
11
12pipeline = FluxPipeline.from_pretrained(model_path, transformer=transformer, torch_dtype=torch.bfloat16).to("cuda")
13
14prompt = "a tiny astronaut hatching from an egg on the moon"
15negative_prompt = "bad photo"
16
17image = pipeline(
18 prompt=prompt,
19 negative_prompt=negative_prompt,
20 guidance_scale=3.5,
21 num_inference_steps=24,
22).images[0]
23
24image.save("de-distill.jpg")