vanhai123 commited on
Commit
41c7051
·
verified ·
1 Parent(s): cc9d47c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -8,8 +8,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
8
  torch_dtype=torch.float16,
9
  )
10
 
11
- # Đưa mô hình lên GPU (nếu có)
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="🧠 Tạo ảnh từ văn bản với Stable Diffusion",
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