ChenyangSi commited on
Commit
7389249
1 Parent(s): bcbecf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +80 -42
app.py CHANGED
@@ -97,49 +97,87 @@ options = ['SD1.4', 'SD1.5', 'SD2.1']
97
  with block:
98
  gr.Markdown("SD vs. FreeU.")
99
  with gr.Row():
100
- with gr.Column():
101
- sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
102
- model_id = "CompVis/stable-diffusion-v1-4"
103
- with gr.Accordion('FreeU Parameters', open=False):
104
- b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
105
- minimum=1,
106
- maximum=1.6,
107
- step=0.1,
108
- value=1)
109
- b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
110
- minimum=1,
111
- maximum=1.6,
112
- step=0.1,
113
- value=1)
114
- s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
115
- minimum=0,
116
- maximum=1,
117
- step=0.1,
118
- value=1)
119
- s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
120
- minimum=0,
121
- maximum=1,
122
- step=0.1,
123
- value=1)
124
- with gr.Group():
125
- with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
126
- with gr.Column():
127
- text = gr.Textbox(
128
- label="Enter your prompt",
129
- show_label=False,
130
- max_lines=1,
131
- placeholder="Enter your prompt",
132
- container=False,
133
- )
134
- btn = gr.Button("Generate image", scale=0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
- with gr.Row():
137
- with gr.Column(min_width=256) as c1:
138
- image_1 = gr.Image(interactive=False)
139
- image_1_label = gr.Markdown("SD")
140
- with gr.Column(min_width=256) as c2:
141
- image_2 = gr.Image(interactive=False)
142
- image_2_label = gr.Markdown("FreeU")
143
 
144
 
145
  ex = gr.Examples(examples=examples, fn=infer, inputs=[text], outputs=[image_1, image_2], cache_examples=False)
 
97
  with block:
98
  gr.Markdown("SD vs. FreeU.")
99
  with gr.Row():
100
+ with gr.Group():
101
+ with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
102
+ with gr.Column():
103
+ text = gr.Textbox(
104
+ label="Enter your prompt",
105
+ show_label=False,
106
+ max_lines=1,
107
+ placeholder="Enter your prompt",
108
+ container=False,
109
+ )
110
+ btn = gr.Button("Generate image", scale=0)
111
+
112
+ with gr.Row():
113
+ with gr.Column(min_width=256) as c1:
114
+ image_1 = gr.Image(interactive=False)
115
+ image_1_label = gr.Markdown("SD")
116
+ with gr.Row():
117
+
118
+
119
+
120
+ with gr.Group():
121
+ with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
122
+ with gr.Column():
123
+ text = gr.Textbox(
124
+ label="Enter your prompt",
125
+ show_label=False,
126
+ max_lines=1,
127
+ placeholder="Enter your prompt",
128
+ container=False,
129
+ )
130
+ btn = gr.Button("Generate image", scale=0)
131
+
132
+ with gr.Row():
133
+ with gr.Column(min_width=256) as c2:
134
+ image_2 = gr.Image(interactive=False)
135
+ image_2_label = gr.Markdown("FreeU")
136
+
137
+
138
+ # with gr.Column():
139
+ # sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
140
+ # model_id = "CompVis/stable-diffusion-v1-4"
141
+ # with gr.Accordion('FreeU Parameters', open=False):
142
+ # b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
143
+ # minimum=1,
144
+ # maximum=1.6,
145
+ # step=0.1,
146
+ # value=1)
147
+ # b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
148
+ # minimum=1,
149
+ # maximum=1.6,
150
+ # step=0.1,
151
+ # value=1)
152
+ # s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
153
+ # minimum=0,
154
+ # maximum=1,
155
+ # step=0.1,
156
+ # value=1)
157
+ # s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
158
+ # minimum=0,
159
+ # maximum=1,
160
+ # step=0.1,
161
+ # value=1)
162
+ # with gr.Group():
163
+ # with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
164
+ # with gr.Column():
165
+ # text = gr.Textbox(
166
+ # label="Enter your prompt",
167
+ # show_label=False,
168
+ # max_lines=1,
169
+ # placeholder="Enter your prompt",
170
+ # container=False,
171
+ # )
172
+ # btn = gr.Button("Generate image", scale=0)
173
 
174
+ # with gr.Row():
175
+ # with gr.Column(min_width=256) as c1:
176
+ # image_1 = gr.Image(interactive=False)
177
+ # image_1_label = gr.Markdown("SD")
178
+ # with gr.Column(min_width=256) as c2:
179
+ # image_2 = gr.Image(interactive=False)
180
+ # image_2_label = gr.Markdown("FreeU")
181
 
182
 
183
  ex = gr.Examples(examples=examples, fn=infer, inputs=[text], outputs=[image_1, image_2], cache_examples=False)