MaxMilan1 commited on
Commit
0fc6bc9
·
1 Parent(s): af84433
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -22,25 +22,23 @@ pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, times
22
 
23
  # Function to generate an image from text using diffusion
24
  @spaces.GPU
25
- def generate_image(prompt, neg_prompt):
26
  prompt += "no background, side view, minimalist shot"
27
 
28
  image = pipe(prompt, num_inference_steps=4, guidance_scale=0).images[0]
29
- image2 = rembg.remove(image)
30
 
31
- return image, image2
32
 
33
  _TITLE = "Shoe Generator"
34
  with gr.Blocks(_TITLE) as ShoeGen:
35
  with gr.Row():
36
  with gr.Column():
37
  prompt = gr.Textbox(label="Enter a discription of a shoe")
38
- neg_prompt = gr.Textbox(label="Enter a negative prompt", value="low quality, watermark, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, closed eyes, text, logo")
39
  button_gen = gr.Button("Generate Image")
40
  with gr.Column():
41
- image = gr.Image(label="Generated Image")
42
- image2 = gr.Image(label="Generated Image without background", show_download_button=True)
43
 
44
- button_gen.click(generate_image, inputs=[prompt], outputs=[image, image2])
45
 
46
  ShoeGen.launch()
 
22
 
23
  # Function to generate an image from text using diffusion
24
  @spaces.GPU
25
+ def generate_image(prompt):
26
  prompt += "no background, side view, minimalist shot"
27
 
28
  image = pipe(prompt, num_inference_steps=4, guidance_scale=0).images[0]
 
29
 
30
+ return image
31
 
32
  _TITLE = "Shoe Generator"
33
  with gr.Blocks(_TITLE) as ShoeGen:
34
  with gr.Row():
35
  with gr.Column():
36
  prompt = gr.Textbox(label="Enter a discription of a shoe")
37
+ # neg_prompt = gr.Textbox(label="Enter a negative prompt", value="low quality, watermark, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, closed eyes, text, logo")
38
  button_gen = gr.Button("Generate Image")
39
  with gr.Column():
40
+ image = gr.Image(label="Generated Image", show_download_button=True)
 
41
 
42
+ button_gen.click(generate_image, inputs=[prompt], outputs=[image])
43
 
44
  ShoeGen.launch()