ysharma HF staff commited on
Commit
d5c7b7a
·
1 Parent(s): 8d3fb0e
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -78,20 +78,20 @@ def engine(text_input):
78
  img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(ent[0],'50','256','256','1',10)[0]
79
  img_list.append(img)
80
 
81
- #Resizing all images produced to same size
82
- resize_img_list = resize(img_list)
83
 
84
- #Convert text to speech using facebook's latest model from HF hub
85
- speech = text2speech(text_input)
86
 
87
- #Calculate the desired frame per second based on given audio length and entities identified
88
- fps= entities_num / 19 #length of audio file #13 / 19
89
 
90
- #Convert string of images into a video
91
- clip = images_to_video(fps, resize_img_list)
92
 
93
- #Merge video and audio created above
94
- merged_file = merge_audio_video(speech, clip)
95
  #{'prompt':text_input,'steps':'50','width':'256','height':'256','images':'1','scale':10}).launch()
96
  #img_intfc = gr.Interface.load("spaces/multimodalart/latentdiffusion", inputs=[gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text")],
97
  #outputs=[gr.outputs.Image(type="pil", label="output image"),gr.outputs.Carousel(label="Individual images",components=["image"]),gr.outputs.Textbox(label="Error")], )
 
78
  img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(ent[0],'50','256','256','1',10)[0]
79
  img_list.append(img)
80
 
81
+ #Resizing all images produced to same size
82
+ resize_img_list = resize(img_list)
83
 
84
+ #Convert text to speech using facebook's latest model from HF hub
85
+ speech = text2speech(text_input)
86
 
87
+ #Calculate the desired frame per second based on given audio length and entities identified
88
+ fps= entities_num / 19 #length of audio file #13 / 19
89
 
90
+ #Convert string of images into a video
91
+ clip = images_to_video(fps, resize_img_list)
92
 
93
+ #Merge video and audio created above
94
+ merged_file = merge_audio_video(speech, clip)
95
  #{'prompt':text_input,'steps':'50','width':'256','height':'256','images':'1','scale':10}).launch()
96
  #img_intfc = gr.Interface.load("spaces/multimodalart/latentdiffusion", inputs=[gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text"), gr.inputs.Textbox(lines=1, label="Input Text")],
97
  #outputs=[gr.outputs.Image(type="pil", label="output image"),gr.outputs.Carousel(label="Individual images",components=["image"]),gr.outputs.Textbox(label="Error")], )