Amruthaa commited on
Commit
eff13ac
1 Parent(s): 78bab9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -22,12 +22,12 @@ def get_caption(img):
22
 
23
  # 4. Image Generation
24
  # img_model = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
25
- img_model = DiffusionPipeline.from_pretrained("Linaqruf/anything-v3.0")
26
- def get_img(prompt):
27
- print("Here inside")
28
- img = img_model(prompt)
29
- print("Generated")
30
- return img.images[0]
31
 
32
 
33
  demo = gr.Blocks()
@@ -48,10 +48,10 @@ with demo:
48
  cap_btn = gr.Button("Generate Caption")
49
  cap_output = [gr.Textbox(label="Caption")]
50
  cap_btn.click(get_caption, cap_input, cap_output)
51
- with gr.Tab("Image Generation"):
52
- img_input = [gr.Textbox(label="Your Text")]
53
- img_btn = gr.Button("Generate Image")
54
- img_output = [gr.Image(label="Generated Image")]
55
- img_btn.click(get_img, img_input, img_output)
56
 
57
  demo.launch()
 
22
 
23
  # 4. Image Generation
24
  # img_model = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
25
+ # img_model = DiffusionPipeline.from_pretrained("Linaqruf/anything-v3.0")
26
+ # def get_img(prompt):
27
+ # print("Here inside")
28
+ # img = img_model(prompt)
29
+ # print("Generated")
30
+ # return img.images[0]
31
 
32
 
33
  demo = gr.Blocks()
 
48
  cap_btn = gr.Button("Generate Caption")
49
  cap_output = [gr.Textbox(label="Caption")]
50
  cap_btn.click(get_caption, cap_input, cap_output)
51
+ # with gr.Tab("Image Generation"):
52
+ # img_input = [gr.Textbox(label="Your Text")]
53
+ # img_btn = gr.Button("Generate Image")
54
+ # img_output = [gr.Image(label="Generated Image")]
55
+ # img_btn.click(get_img, img_input, img_output)
56
 
57
  demo.launch()