Spaces:
Runtime error
Runtime error
Commit
·
7d2016d
1
Parent(s):
f9be0ac
Update app.py
Browse files
app.py
CHANGED
@@ -14,10 +14,10 @@ pip_sd = pip_sd.to("cuda")
|
|
14 |
|
15 |
pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
16 |
pip_freeu = pip_freeu.to("cuda")
|
17 |
-
# -------- freeu block registration
|
18 |
-
register_free_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
19 |
-
register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
20 |
-
# -------- freeu block registration
|
21 |
|
22 |
def infer(prompt):
|
23 |
|
@@ -110,48 +110,27 @@ with block:
|
|
110 |
)
|
111 |
btn = gr.Button("Generate image", scale=0)
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
|
136 |
-
minimum=1,
|
137 |
-
maximum=1.6,
|
138 |
-
step=0.1,
|
139 |
-
value=1)
|
140 |
-
b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
|
141 |
-
minimum=1,
|
142 |
-
maximum=1.6,
|
143 |
-
step=0.1,
|
144 |
-
value=1)
|
145 |
-
s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
|
146 |
-
minimum=0,
|
147 |
-
maximum=1,
|
148 |
-
step=0.1,
|
149 |
-
value=1)
|
150 |
-
s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
|
151 |
-
minimum=0,
|
152 |
-
maximum=1,
|
153 |
-
step=0.1,
|
154 |
-
value=1)
|
155 |
|
156 |
with gr.Row():
|
157 |
with gr.Column(min_width=256) as c1:
|
|
|
14 |
|
15 |
pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
16 |
pip_freeu = pip_freeu.to("cuda")
|
17 |
+
# # -------- freeu block registration
|
18 |
+
# register_free_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
19 |
+
# register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
20 |
+
# # -------- freeu block registration
|
21 |
|
22 |
def infer(prompt):
|
23 |
|
|
|
110 |
)
|
111 |
btn = gr.Button("Generate image", scale=0)
|
112 |
|
113 |
+
with gr.Accordion('FreeU Parameters', open=False):
|
114 |
+
b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
|
115 |
+
minimum=1,
|
116 |
+
maximum=1.6,
|
117 |
+
step=0.1,
|
118 |
+
value=1)
|
119 |
+
b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
|
120 |
+
minimum=1,
|
121 |
+
maximum=1.6,
|
122 |
+
step=0.1,
|
123 |
+
value=1)
|
124 |
+
s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
|
125 |
+
minimum=0,
|
126 |
+
maximum=1,
|
127 |
+
step=0.1,
|
128 |
+
value=1)
|
129 |
+
s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
|
130 |
+
minimum=0,
|
131 |
+
maximum=1,
|
132 |
+
step=0.1,
|
133 |
+
value=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
with gr.Row():
|
136 |
with gr.Column(min_width=256) as c1:
|