linoyts HF staff commited on
Commit
ccc38b8
1 Parent(s): ea347bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -33
app.py CHANGED
@@ -130,6 +130,14 @@ css = '''
130
  #image_out{position:absolute; width: 80%; right: 10px; top: 40px}
131
  '''
132
  with gr.Blocks(css=css) as demo:
 
 
 
 
 
 
 
 
133
 
134
  x_concept_1 = gr.State("")
135
  x_concept_2 = gr.State("")
@@ -141,39 +149,39 @@ with gr.Blocks(css=css) as demo:
141
 
142
  recalc_directions = gr.State(False)
143
 
144
- with gr.Tab("text2image"):
145
- with gr.Row():
146
- with gr.Column():
147
- slider_x = gr.Dropdown(label="Slider concept range", allow_custom_value=True, multiselect=True, max_choices=2)
148
- #slider_y = gr.Dropdown(label="Slider Y concept range", allow_custom_value=True, multiselect=True, max_choices=2)
149
- prompt = gr.Textbox(label="Prompt")
150
- submit = gr.Button("find directions")
151
- with gr.Column():
152
- with gr.Group(elem_id="group"):
153
- x = gr.Slider(minimum=-3, value=0, maximum=3.5, elem_id="x", interactive=False)
154
- #y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
155
- output_image = gr.Image(elem_id="image_out")
156
- # with gr.Row():
157
- # generate_butt = gr.Button("generate")
158
-
159
- with gr.Accordion(label="advanced options", open=False):
160
- iterations = gr.Slider(label = "num iterations", minimum=0, value=200, maximum=400)
161
- steps = gr.Slider(label = "num inference steps", minimum=1, value=4, maximum=10)
162
- guidance_scale = gr.Slider(
163
- label="Guidance scale",
164
- minimum=0.1,
165
- maximum=10.0,
166
- step=0.1,
167
- value=5,
168
- )
169
- # correlation = gr.Slider(
170
- # label="correlation",
171
- # minimum=0.1,
172
- # maximum=1.0,
173
- # step=0.05,
174
- # value=0.6,
175
- # )
176
- seed = gr.Slider(minimum=0, maximum=np.iinfo(np.int32).max, label="Seed", interactive=True, randomize=True)
177
 
178
 
179
  # with gr.Tab(label="image2image"):
 
130
  #image_out{position:absolute; width: 80%; right: 10px; top: 40px}
131
  '''
132
  with gr.Blocks(css=css) as demo:
133
+ gr.Markdown("""
134
+ <div style="text-align: center; font-size: 28px; font-weight: bold; margin-bottom: 20px;">
135
+ Latent Navigation
136
+ </div>
137
+ <div style="text-align: center; font-size: 16px; margin-bottom: 20px;">
138
+ Explorations in CLIP Space 🪐
139
+ </div>
140
+ """)
141
 
142
  x_concept_1 = gr.State("")
143
  x_concept_2 = gr.State("")
 
149
 
150
  recalc_directions = gr.State(False)
151
 
152
+ #with gr.Tab("text2image"):
153
+ with gr.Row():
154
+ with gr.Column():
155
+ slider_x = gr.Dropdown(label="Slider concept range", allow_custom_value=True, multiselect=True, max_choices=2)
156
+ #slider_y = gr.Dropdown(label="Slider Y concept range", allow_custom_value=True, multiselect=True, max_choices=2)
157
+ prompt = gr.Textbox(label="Prompt")
158
+ submit = gr.Button("find directions")
159
+ with gr.Column():
160
+ with gr.Group(elem_id="group"):
161
+ x = gr.Slider(minimum=-3, value=0, maximum=3.5, elem_id="x", interactive=False)
162
+ #y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
163
+ output_image = gr.Image(elem_id="image_out")
164
+ # with gr.Row():
165
+ # generate_butt = gr.Button("generate")
166
+
167
+ with gr.Accordion(label="advanced options", open=False):
168
+ iterations = gr.Slider(label = "num iterations", minimum=0, value=200, maximum=400)
169
+ steps = gr.Slider(label = "num inference steps", minimum=1, value=4, maximum=10)
170
+ guidance_scale = gr.Slider(
171
+ label="Guidance scale",
172
+ minimum=0.1,
173
+ maximum=10.0,
174
+ step=0.1,
175
+ value=5,
176
+ )
177
+ # correlation = gr.Slider(
178
+ # label="correlation",
179
+ # minimum=0.1,
180
+ # maximum=1.0,
181
+ # step=0.05,
182
+ # value=0.6,
183
+ # )
184
+ seed = gr.Slider(minimum=0, maximum=np.iinfo(np.int32).max, label="Seed", interactive=True, randomize=True)
185
 
186
 
187
  # with gr.Tab(label="image2image"):