Views
No views yet




1import torch
2from diffusers.pipelines import FluxPipeline
3
4model_id = "black-forest-labs/FLUX.1-dev"
5adapter_id = "alimama-creative/FLUX.1-Turbo-Alpha"
6
7pipe = FluxPipeline.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16
10)
11pipe.to("cuda")
12
13pipe.load_lora_weights(adapter_id)
14pipe.fuse_lora()
15
16prompt = "A DSLR photo of a shiny VW van that has a cityscape painted on it. A smiling sloth stands on grass in front of the van and is wearing a leather jacket, a cowboy hat, a kilt and a bowtie. The sloth is holding a quarterstaff and a big book."
17image = pipe(
18 prompt=prompt,
19 guidance_scale=3.5,
20 height=1024,
21 width=1024,
22 num_inference_steps=8,
23 max_sequence_length=512).images[0]