aryanbaghel's picture
Update README.md
b769a26 verified
# ๐Ÿ“ฑ UI Generator Prototype โ€“ LoRA Fine-Tuned SDXL Model
[![Hugging Face](https://img.shields.io/badge/hosted%20on-Hugging%20Face-blue)](https://huggingface.co/aryanbaghel/ui-generator-prototype)
[![Model Type](https://img.shields.io/badge/model-LoRA%20SDXL-green)]()
[![License](https://img.shields.io/badge/license-Apache--2.0-lightgrey)]()
A LoRA fine-tuned [Stable Diffusion XL (SDXL)](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) 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.
---
## ๐Ÿš€ Model Summary
- **Base Model**: `stabilityai/stable-diffusion-xl-base-1.0`
- **LoRA Adapter**: Fine-tuned using [Diffusers](https://github.com/huggingface/diffusers)
- **Domain**: Mobile User Interfaces
- **Dataset**: 900+ captioned UI screenshots
โ†’ [aryanbaghel/ui-caption-padded](https://huggingface.co/datasets/aryanbaghel/ui-caption-padded)
- **Training Goal**: Enhance SDXLโ€™s ability to generate UI screens from structured descriptive prompts.
---
## ๐Ÿง  Use Cases
- Prototyping UI design ideas from prompts
- UX/UI design automation
- Visualizing layout sketches for mobile apps
- Creative ideation for product design teams
---
## ๐Ÿ“ฆ How to Use
```python
from 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!")