Views
No views yet
ethnographic photography of teddy bear at a picnic7.50.750None4210241import torch
2from diffusers import DiffusionPipeline
3
4model_id = '/black-forest-labs/FLUX.1-dev'
5adapter_id = 'flux_Training'
6pipeline = DiffusionPipeline.from_pretrained(model_id)\pipeline.load_adapter(adapter_id)
7
8prompt = "ethnographic photography of teddy bear at a picnic"
9negative_prompt = "blurry, cropped, ugly"
10
11pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
12image = pipeline(
13 prompt=prompt,
14 negative_prompt='blurry, cropped, ugly',
15 num_inference_steps=50,
16 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
17 width=1152,
18 height=768,
19 guidance_scale=7.5,
20 guidance_rescale=0.7,
21).images[0]
22image.save("output.png", format="PNG")