File size: 2,100 Bytes
395b7b9 05fe277 395b7b9 3958dbb 395b7b9 3958dbb 395b7b9 3958dbb 96e6a0f 3958dbb 96e6a0f 3958dbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
---
tags:
- text-to-image
- stable-diffusion
- lora
- diffusers
language:
- en
library_name: diffusers
pipeline_tag: text-to-image
base_model: stabilityai/stable-diffusion-2-base
instance_prompt: "Mobile app:"
---
# UI-Diffuser-V2
UI-Diffuser-V2 is fine tuned from "stabilityai/stable-diffusion-2-base" with the [SCapRepo dataset](https://paperswithcode.com/dataset/gpscap) for mobile UI generation.
A demo using diffusion model and large language model for UI generation is available at https://github.com/Jl-wei/ai-gen-ui
## Using with Diffusers
```python
import torch
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
model_id = "stabilityai/stable-diffusion-2-base"
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
lora_path = "Jl-wei/ui-diffuser-v2"
pipe.load_lora_weights(lora_path)
pipe.to("cuda")
prompt = "Mobile app: health monitoring report"
images = pipe(prompt, num_inference_steps=30, guidance_scale=7.5, height=512, width=288, num_images_per_prompt=10).images
columns = 5
fig = plt.figure(figsize=(20,10))
for i, image in enumerate(images):
plt.subplot(int(len(images) / columns), columns, i + 1)
plt.imshow(image)
for ax in fig.axes:
ax.axis("off")
```
## Citation
If you find our work useful, please cite our paper:
```bibtex
@article{wei2024aiinspired,
author={Wei, Jialiang and Courbis, Anne-Lise and Lambolais, Thomas and Dray, Gérard and Maalej, Walid},
journal={IEEE Software},
title={On AI-Inspired User Interface Design},
year={2025},
volume={42},
number={3},
pages={50-58},
doi={10.1109/MS.2025.3536838}
}
```
Please note that the code and model can only be used for academic purpose.
### UI-Diffuser-V1
This model, UI-Diffuser-V2, represents the second version of the UI-Diffuser model.
The initial version, UI-Diffuser-V1, was introduced in our paper titled [Boosting GUI Prototyping with Diffusion Models](https://ieeexplore.ieee.org/abstract/document/10260853) |