Views
No views yet
b8m home bathroom interior design. The bright and clean bathroom area. The walls are finished with white tiles, and the ceiling is also neatly finished with white paint. The floor is finished with white tiles in a herringbone pattern, further emphasizing the bright feel of the entire space. The main color is white, silver is used as a secondary color. White makes the space look wide and clean, silver adds a sleek modern touch.4.00.050FlowMatchEulerDiscreteScheduler421024x1024, 1024x896, 1280x7681import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'stabilityai/stable-diffusion-3.5-large'
5adapter_id = 'daehuncho/bathroom_lora_1024'
6pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "b8m home bathroom interior design. The bright and clean bathroom area. The walls are finished with white tiles, and the ceiling is also neatly finished with white paint. The floor is finished with white tiles in a herringbone pattern, further emphasizing the bright feel of the entire space. The main color is white, silver is used as a secondary color. White makes the space look wide and clean, silver adds a sleek modern touch."
10negative_prompt = 'blurry, cropped, ugly'
11
12## Optional: quantise the model to save on vram.
13## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
14from optimum.quanto import quantize, freeze, qint8
15quantize(pipeline.transformer, weights=qint8)
16freeze(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 negative_prompt=negative_prompt,
22 num_inference_steps=50,
23 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
24 width=1024,
25 height=1024,
26 guidance_scale=4.0,
27 skip_guidance_layers=[7, 8, 9],
28).images[0]
29image.save("output.png", format="PNG")