Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- text-to-image
|
4 |
+
- stable-diffusion
|
5 |
+
- lora
|
6 |
+
- diffusers
|
7 |
+
language:
|
8 |
+
- en
|
9 |
+
library_name: diffusers
|
10 |
+
pipeline_tag: text-to-image
|
11 |
+
base_model: stabilityai/stable-diffusion-2-base
|
12 |
+
instance_prompt: "Mobile app:"
|
13 |
+
---
|
14 |
+
|
15 |
+
# UI-Diffuser-V2
|
16 |
+
UI-Diffuser-V2 is fine tuned from "stabilityai/stable-diffusion-2-base" with the [GPSCap dataset](https://github.com/jl-wei/guing) for mobile UI generation.
|
17 |
+
|
18 |
+
This iteration, UI-Diffuser-V2, represents the second version of the UI-Diffuser model.
|
19 |
+
|
20 |
+
The first version, UI-Diffuser-V1, was introduced in our paper titled [Boosting GUI Prototyping with Diffusion Models](https://ieeexplore.ieee.org/abstract/document/10260853)
|
21 |
+
|
22 |
+
Using with Diffusers
|
23 |
+
```python
|
24 |
+
import torch
|
25 |
+
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
26 |
+
|
27 |
+
model_id = "stabilityai/stable-diffusion-2-base"
|
28 |
+
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
29 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
|
30 |
+
|
31 |
+
lora_path = "Jl-wei/ui-diffuser-v2"
|
32 |
+
pipe.load_lora_weights(lora_path)
|
33 |
+
pipe.to("cuda")
|
34 |
+
|
35 |
+
prompt = "Mobile app: health monitoring report"
|
36 |
+
images = pipe(prompt, num_inference_steps=30, guidance_scale=7.5, height=512, width=288, num_images_per_prompt=10).images
|
37 |
+
|
38 |
+
columns = 5
|
39 |
+
fig = plt.figure(figsize=(20,10))
|
40 |
+
for i, image in enumerate(images):
|
41 |
+
plt.subplot(int(len(images) / columns), columns, i + 1)
|
42 |
+
plt.imshow(image)
|
43 |
+
for ax in fig.axes:
|
44 |
+
ax.axis("off")
|
45 |
+
```
|
46 |
+
|
47 |
+
Please note that the model can only be used for academic purpose.
|