Cognomen commited on
Commit
858501a
Β·
1 Parent(s): 7aebef6

fix interface

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -38,19 +38,31 @@ def infer(prompt, negative_prompt, image):
38
  prompt,
39
  cond_input,
40
  generator=generator,
41
- num_images_per_prompt=1,
42
  num_inference_steps=20
43
  )
44
 
45
  return output
46
 
47
- # you need to pass inputs and outputs according to inference function
48
- title = "Categorical Conditioning Controlnet for One-Shot Image Stylization."
49
- description = "This is a demo on ControlNet which generates images based on the style of the conditioning input."
50
- # you need to pass your examples according to your inputs
51
- # each inner list is one example, each element in the list corresponding to a component in the `inputs`.
52
- examples = [["1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, watercolor, night, turtleneck", "low quality", "wikipe_cond_1.png"]]
53
- gr.Interface(fn = infer, inputs = ["text", "text", gr.Image(type="pil") ], outputs = "image",
54
- title = title, description = description, examples = examples, theme='gradio/soft').launch()
55
-
 
 
 
 
 
 
 
 
 
 
 
 
56
 
 
38
  prompt,
39
  cond_input,
40
  generator=generator,
41
+ num_images_per_prompt=4,
42
  num_inference_steps=20
43
  )
44
 
45
  return output
46
 
47
+ gr.Interface(
48
+ infer,
49
+ inputs=[
50
+ gr.Textbox(
51
+ label="Enter prompt",
52
+ max_lines=1,
53
+ placeholder="1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, watercolor, night, turtleneck",
54
+ ),
55
+ gr.Textbox(
56
+ label="Enter negative prompt",
57
+ max_lines=1,
58
+ placeholder="low quality",
59
+ ),
60
+ gr.Image(type="pil"),
61
+ ],
62
+ outputs=gr.Gallery().style(grid=[2], height="auto"),
63
+ title="Generate controlled outputs with Categorical Conditioning on Waifu Diffusion 1.5 beta 2.",
64
+ description="This Space uses image examples as style conditioning.",
65
+ examples=[["wikipe_cond_1.png", "1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, watercolor, night, turtleneck"]],
66
+ allow_flagging=False,
67
+ ).launch(enable_queue=True)
68