apolinario
commited on
Commit
·
071944b
1
Parent(s):
a0c074d
Hide guided
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ latent = gr.Interface.load("spaces/multimodalart/latentdiffusion")
|
|
6 |
print(latent)
|
7 |
rudalle = gr.Interface.load("spaces/multimodalart/rudalle")
|
8 |
print(rudalle)
|
9 |
-
guided = gr.Interface.load("spaces/EleutherAI/clip-guided-diffusion")
|
10 |
-
print(guided)
|
11 |
def text2image_latent(text,steps,width,height,images,diversity):
|
12 |
image = latent(text, steps, width, height, images, diversity)[0]
|
13 |
return(image)
|
@@ -21,11 +21,11 @@ def text2image_rudalle(text,aspect,model):
|
|
21 |
return(image)
|
22 |
|
23 |
|
24 |
-
def text2image_guided(text):
|
25 |
-
image = guided(text, None, 10, 600, 0, 0, 0, random.randint(0,2147483647), None, 50, 32)
|
26 |
-
print(image)
|
27 |
-
image = image[0]
|
28 |
-
return(image)
|
29 |
|
30 |
block = gr.Blocks()
|
31 |
|
@@ -45,9 +45,9 @@ with gr.Blocks() as mindseye:
|
|
45 |
aspect = gr.inputs.Radio(label="Aspect Ratio", choices=["Square", "Horizontal", "Vertical"],default="Square")
|
46 |
model = gr.inputs.Dropdown(label="Model", choices=["Surrealism","Realism", "Emoji"], default="Surrealism")
|
47 |
get_image_rudalle = gr.Button("Generate Image")
|
48 |
-
with gr.TabItem("guided"):
|
49 |
-
|
50 |
-
|
51 |
#get_image = gr.Button("Generate Image")
|
52 |
with gr.Column():
|
53 |
with gr.Row():
|
@@ -56,5 +56,5 @@ with gr.Blocks() as mindseye:
|
|
56 |
print(which_tab)
|
57 |
get_image_latent.click(text2image_latent, inputs=[text,steps,width,height,images,diversity], outputs=image)
|
58 |
get_image_rudalle.click(text2image_rudalle, inputs=[text,aspect,model], outputs=image)
|
59 |
-
get_image_guided.click(text2image_guided, inputs=text, outputs=image)
|
60 |
mindseye.launch()
|
|
|
6 |
print(latent)
|
7 |
rudalle = gr.Interface.load("spaces/multimodalart/rudalle")
|
8 |
print(rudalle)
|
9 |
+
#guided = gr.Interface.load("spaces/EleutherAI/clip-guided-diffusion")
|
10 |
+
#print(guided)
|
11 |
def text2image_latent(text,steps,width,height,images,diversity):
|
12 |
image = latent(text, steps, width, height, images, diversity)[0]
|
13 |
return(image)
|
|
|
21 |
return(image)
|
22 |
|
23 |
|
24 |
+
#def text2image_guided(text):
|
25 |
+
# image = guided(text, None, 10, 600, 0, 0, 0, random.randint(0,2147483647), None, 50, 32)
|
26 |
+
# print(image)
|
27 |
+
# image = image[0]
|
28 |
+
# return(image)
|
29 |
|
30 |
block = gr.Blocks()
|
31 |
|
|
|
45 |
aspect = gr.inputs.Radio(label="Aspect Ratio", choices=["Square", "Horizontal", "Vertical"],default="Square")
|
46 |
model = gr.inputs.Dropdown(label="Model", choices=["Surrealism","Realism", "Emoji"], default="Surrealism")
|
47 |
get_image_rudalle = gr.Button("Generate Image")
|
48 |
+
#with gr.TabItem("guided"):
|
49 |
+
# which_tab = "Guided Diffusion"
|
50 |
+
# get_image_guided = gr.Button("Generate Image")
|
51 |
#get_image = gr.Button("Generate Image")
|
52 |
with gr.Column():
|
53 |
with gr.Row():
|
|
|
56 |
print(which_tab)
|
57 |
get_image_latent.click(text2image_latent, inputs=[text,steps,width,height,images,diversity], outputs=image)
|
58 |
get_image_rudalle.click(text2image_rudalle, inputs=[text,aspect,model], outputs=image)
|
59 |
+
#get_image_guided.click(text2image_guided, inputs=text, outputs=image)
|
60 |
mindseye.launch()
|