| # ๐ฑ UI Generator Prototype โ LoRA Fine-Tuned SDXL Model | |
| [](https://huggingface.co/aryanbaghel/ui-generator-prototype) | |
| []() | |
| []() | |
| 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!") |