Spaces:
Running
Running
tokeron
commited on
Commit
·
12ff912
1
Parent(s):
0ee5077
no need label
Browse files
app.py
CHANGED
|
@@ -32,8 +32,12 @@ def display_images(images):
|
|
| 32 |
|
| 33 |
def get_prompt(prompt):
|
| 34 |
print('prompt:', prompt)
|
| 35 |
-
|
|
|
|
| 36 |
|
|
|
|
|
|
|
|
|
|
| 37 |
for skip_layers in range(24): # loop from 0 to 23
|
| 38 |
image = get_images(prompt, skip_layers=skip_layers)
|
| 39 |
gallery.update(image) # update the gallery with the new image
|
|
@@ -47,6 +51,6 @@ with gr.Blocks() as demo:
|
|
| 47 |
label="Generated images", show_label=False, elem_id="gallery",
|
| 48 |
columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
|
| 49 |
btn = gr.Button("Generate images", scale=0)
|
| 50 |
-
|
| 51 |
-
btn.click(
|
| 52 |
demo.launch()
|
|
|
|
| 32 |
|
| 33 |
def get_prompt(prompt):
|
| 34 |
print('prompt:', prompt)
|
| 35 |
+
return prompt
|
| 36 |
+
|
| 37 |
|
| 38 |
+
|
| 39 |
+
def generate_images(prompt):
|
| 40 |
+
print('calling diffusion lens')
|
| 41 |
for skip_layers in range(24): # loop from 0 to 23
|
| 42 |
image = get_images(prompt, skip_layers=skip_layers)
|
| 43 |
gallery.update(image) # update the gallery with the new image
|
|
|
|
| 51 |
label="Generated images", show_label=False, elem_id="gallery",
|
| 52 |
columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
|
| 53 |
btn = gr.Button("Generate images", scale=0)
|
| 54 |
+
text_input = gr.Interface(fn=get_prompt, inputs="text", outputs="text")
|
| 55 |
+
btn.click(generate_images, text_input, gallery) # pass the text input interface to btn.click()
|
| 56 |
demo.launch()
|