Views
No views yet
A girl in light blue sits at the bar counter, holding an ice-cold wine glass and drinking alone on top of the Eiffel Tower, with a night view outside the window.. It features a close-up shot of her sitting by herself. She has long hair, wears glasses, faces away from the camera, and is wearing white shoes, black pants, a gray jacket, and a green scarf. with bright colors and a Paris night background featuring the Eiffel Tower. The composition is elegant, with the woman sitting on a high stool3.00.020None421024x10241import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'black-forest-labs/FLUX.1-dev'
5adapter_id = 'linhqyy/jazzy-st-1411'
6pipeline = DiffusionPipeline.from_pretrained(model_id), torch_dtype=torch.bfloat16) # loading directly in bf16
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "A girl in light blue sits at the bar counter, holding an ice-cold wine glass and drinking alone on top of the Eiffel Tower, with a night view outside the window.. It features a close-up shot of her sitting by herself. She has long hair, wears glasses, faces away from the camera, and is wearing white shoes, black pants, a gray jacket, and a green scarf. with bright colors and a Paris night background featuring the Eiffel Tower. The composition is elegant, with the woman sitting on a high stool"
10
11
12## Optional: quantise the model to save on vram.
13## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
14#from optimum.quanto import quantize, freeze, qint8
15#quantize(pipeline.transformer, weights=qint8)
16#freeze(pipeline.transformer)
17
18pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
19image = pipeline(
20 prompt=prompt,
21 num_inference_steps=20,
22 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
23 width=1024,
24 height=1024,
25 guidance_scale=3.0,
26).images[0]
27image.save("output.png", format="PNG")