apolinario commited on
Commit
a0c074d
1 Parent(s): e94d44b

tentative use of new api

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -29,25 +29,25 @@ def text2image_guided(text):
29
 
30
  block = gr.Blocks()
31
 
32
- with block:
33
  text = gr.inputs.Textbox(placeholder="Try writing something..")
34
- which_tab = "Latent Diffusion"
35
- with gr.Tab("latent"):
36
- which_tab = "Latent Diffusion"
37
- steps = gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=45,maximum=50,minimum=1,step=1)
38
- width = gr.inputs.Radio(label="Width", choices=[32,64,128,256],default=256)
39
- height = gr.inputs.Radio(label="Height", choices=[32,64,128,256],default=256)
40
- images = gr.inputs.Slider(label="Images - How many images you wish to generate", default=2, step=1, minimum=1, maximum=4)
41
- diversity = gr.inputs.Slider(label="Diversity scale - How different from one another you wish the images to be",default=5.0, minimum=1.0, maximum=15.0)
42
- get_image_latent = gr.Button("Generate Image")
43
- with gr.Tab("rudalle"):
44
- which_tab = "ruDALLE"
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.Tab("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():
@@ -57,4 +57,4 @@ with block:
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
- block.launch()
 
29
 
30
  block = gr.Blocks()
31
 
32
+ with gr.Blocks() as mindseye:
33
  text = gr.inputs.Textbox(placeholder="Try writing something..")
34
+ with gr.Tabs():
35
+ with gr.TabItem("Latent"):
36
+ which_tab = "Latent Diffusion"
37
+ steps = gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=45,maximum=50,minimum=1,step=1)
38
+ width = gr.inputs.Radio(label="Width", choices=[32,64,128,256],default=256)
39
+ height = gr.inputs.Radio(label="Height", choices=[32,64,128,256],default=256)
40
+ images = gr.inputs.Slider(label="Images - How many images you wish to generate", default=2, step=1, minimum=1, maximum=4)
41
+ diversity = gr.inputs.Slider(label="Diversity scale - How different from one another you wish the images to be",default=5.0, minimum=1.0, maximum=15.0)
42
+ get_image_latent = gr.Button("Generate Image")
43
+ with gr.TabItem("Rudalle"):
44
+ which_tab = "ruDALLE"
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():
 
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()