Spaces:
Build error
Build error
Update template/app.py
Browse files- template/app.py +5 -6
template/app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
|
6 |
-
|
7 |
prefix = '$prefix'
|
8 |
|
9 |
scheduler = DPMSolverMultistepScheduler(
|
@@ -20,12 +20,12 @@ scheduler = DPMSolverMultistepScheduler(
|
|
20 |
)
|
21 |
|
22 |
pipe = StableDiffusionPipeline.from_pretrained(
|
23 |
-
|
24 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
25 |
scheduler=scheduler)
|
26 |
|
27 |
pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
|
28 |
-
|
29 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
30 |
scheduler=scheduler)
|
31 |
|
@@ -94,11 +94,10 @@ with gr.Blocks(css=css) as demo:
|
|
94 |
f"""
|
95 |
<div class="main-div">
|
96 |
<div>
|
97 |
-
<h1>$
|
98 |
</div>
|
99 |
<p>
|
100 |
-
|
101 |
-
Add the following tokens to your prompts for the effect: <b>$prefix</b>.
|
102 |
</p>
|
103 |
Running on <b>{"GPU π₯" if torch.cuda.is_available() else "CPU π₯Ά"}</b>
|
104 |
</div>
|
|
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
|
6 |
+
model_id = '$model_id'
|
7 |
prefix = '$prefix'
|
8 |
|
9 |
scheduler = DPMSolverMultistepScheduler(
|
|
|
20 |
)
|
21 |
|
22 |
pipe = StableDiffusionPipeline.from_pretrained(
|
23 |
+
model_id,
|
24 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
25 |
scheduler=scheduler)
|
26 |
|
27 |
pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
|
28 |
+
model_id,
|
29 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
30 |
scheduler=scheduler)
|
31 |
|
|
|
94 |
f"""
|
95 |
<div class="main-div">
|
96 |
<div>
|
97 |
+
<h1>$title</h1>
|
98 |
</div>
|
99 |
<p>
|
100 |
+
$description
|
|
|
101 |
</p>
|
102 |
Running on <b>{"GPU π₯" if torch.cuda.is_available() else "CPU π₯Ά"}</b>
|
103 |
</div>
|