Views
No views yet
A simple, clear line drawing of a right-angled triangle. The right angle is positioned at the bottom left corner. The base of the triangle is labeled as '4 cm' and the height is labeled as '5 cm'. The triangle is drawn on a plain white background.3.00.025None425121import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'stabilityai/stable-diffusion-3-medium-diffusers'
5adapter_id = 'hugaiagent/SOL-Geometrical-Solana-Lora'
6pipeline = DiffusionPipeline.from_pretrained(model_id)
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "A simple, clear line drawing of a right-angled triangle. The right angle is positioned at the bottom left corner. The base of the triangle is labeled as '4 cm' and the height is labeled as '5 cm'. The triangle is drawn on a plain white background."
10negative_prompt = 'blurry, cropped, ugly, 3d, colorful'
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=negative_prompt,
15 num_inference_steps=25,
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=512,
18 height=512,
19 guidance_scale=3.0,
20).images[0]
21image.save("output.png", format="PNG")