Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
|
|
8 |
torch_dtype=torch.float16,
|
9 |
)
|
10 |
|
11 |
-
|
12 |
-
pipe.to("cuda")
|
13 |
pipe.enable_attention_slicing()
|
14 |
|
15 |
# Hàm sinh ảnh từ prompt
|
@@ -22,7 +21,7 @@ demo = gr.Interface(
|
|
22 |
fn=generate_image,
|
23 |
inputs=gr.Textbox(lines=2, placeholder="Nhập mô tả bằng tiếng Anh...", label="Prompt"),
|
24 |
outputs=gr.Image(label="Ảnh tạo ra"),
|
25 |
-
title="
|
26 |
description="Ví dụ: 'handwritten Vietnamese text on white paper' hoặc 'bold black Vietnamese text on wooden background'"
|
27 |
)
|
28 |
|
|
|
8 |
torch_dtype=torch.float16,
|
9 |
)
|
10 |
|
11 |
+
pipe.to("cpu")
|
|
|
12 |
pipe.enable_attention_slicing()
|
13 |
|
14 |
# Hàm sinh ảnh từ prompt
|
|
|
21 |
fn=generate_image,
|
22 |
inputs=gr.Textbox(lines=2, placeholder="Nhập mô tả bằng tiếng Anh...", label="Prompt"),
|
23 |
outputs=gr.Image(label="Ảnh tạo ra"),
|
24 |
+
title="Tạo ảnh từ văn bản với Stable Diffusion",
|
25 |
description="Ví dụ: 'handwritten Vietnamese text on white paper' hoặc 'bold black Vietnamese text on wooden background'"
|
26 |
)
|
27 |
|