Downloads · 30 days
0
aryanbaghel/ui-generator-prototype
ui-generator-prototype is a machine learning model from aryanbaghel. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
[](https://huggingface.co/aryanbaghel/ui-generator-prototype) []() []()
Downloads · 30 days
0
Access
Public
Updated May 1, 2025
Repo size
53.4 MB
Likes
1
Public
Click a slice to open those files.
.safetensors29.9 MB · 56%
From the Hugging Face model README
A LoRA fine-tuned Stable Diffusion XL (SDXL) model designed to generate highly detailed mobile UI screens from natural language prompts. This prototype specializes in generating UIs with accurate layout structure, typography, color codes, padding, and spacing.
stabilityai/stable-diffusion-xl-base-1.0from diffusers import DiffusionPipeline
import torch
# Load base SDXL model
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.to("cuda")
# Load LoRA weights
pipe.load_lora_weights("aryanbaghel/ui-generator-prototype")
# Enable LoRA
pipe.fuse_lora()
# Generate a UI screen
prompt = "A mobile UI showing a hotel reservation screen with elegant typography and clean layout"
image = pipe(prompt=prompt).images[0]
image.save("output.png")
print("SUCCESS!")