Spaces:
Runtime error
Runtime error
Commit
·
94556e7
1
Parent(s):
d4c4d78
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from PIL import Image
|
3 |
import torch
|
4 |
-
from muse import PipelineMuse
|
5 |
-
# from diffusers import AutoPipelineForText2Image, UniPCMultistepScheduler
|
6 |
-
|
7 |
-
|
8 |
-
# import argparse, os, sys, glob
|
9 |
-
# sys.path.append(os.path.split(sys.path[0])[0])
|
10 |
|
11 |
from diffusers import StableDiffusionPipeline
|
12 |
-
import torch
|
13 |
from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
|
14 |
|
15 |
torch.manual_seed(42)
|
@@ -114,8 +107,7 @@ with block:
|
|
114 |
placeholder="Enter your prompt",
|
115 |
container=False,
|
116 |
)
|
117 |
-
|
118 |
-
btn = gr.Button("Generate image")
|
119 |
|
120 |
# sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
|
121 |
# model_id = "CompVis/stable-diffusion-v1-4"
|
@@ -137,28 +129,28 @@ with block:
|
|
137 |
# register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
138 |
# # -------- freeu block registration
|
139 |
|
140 |
-
with gr.Accordion('FreeU Parameters', open=False):
|
141 |
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
|
163 |
with gr.Row():
|
164 |
with gr.Column(min_width=256) as c1:
|
|
|
1 |
import gradio as gr
|
2 |
from PIL import Image
|
3 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
from diffusers import StableDiffusionPipeline
|
|
|
6 |
from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
|
7 |
|
8 |
torch.manual_seed(42)
|
|
|
107 |
placeholder="Enter your prompt",
|
108 |
container=False,
|
109 |
)
|
110 |
+
btn = gr.Button("Generate image", scale=0)
|
|
|
111 |
|
112 |
# sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
|
113 |
# model_id = "CompVis/stable-diffusion-v1-4"
|
|
|
129 |
# register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
130 |
# # -------- freeu block registration
|
131 |
|
132 |
+
# with gr.Accordion('FreeU Parameters', open=False):
|
133 |
|
134 |
+
b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
|
135 |
+
minimum=1,
|
136 |
+
maximum=1.6,
|
137 |
+
step=0.1,
|
138 |
+
value=1)
|
139 |
+
b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
|
140 |
+
minimum=1,
|
141 |
+
maximum=1.6,
|
142 |
+
step=0.1,
|
143 |
+
value=1)
|
144 |
+
s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
|
145 |
+
minimum=0,
|
146 |
+
maximum=1,
|
147 |
+
step=0.1,
|
148 |
+
value=1)
|
149 |
+
s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
|
150 |
+
minimum=0,
|
151 |
+
maximum=1,
|
152 |
+
step=0.1,
|
153 |
+
value=1)
|
154 |
|
155 |
with gr.Row():
|
156 |
with gr.Column(min_width=256) as c1:
|