Skip to content

Commit

Permalink
[OUT]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Apr 16, 2024
1 parent 95767ae commit 0dea8d6
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions text_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,25 @@ def text_to_video(
beta_schedule="linear",
)

outputs = []
for i in range(n):
output = pipe(
prompt=task,
guidance_scale=guidance_scale,
num_inference_steps=inference_steps,
)
outputs.append(output)
if output_type == ".gif":
out = export_to_gif([output], f"{output_path}_{i}.gif")
else:
out = export_to_video([output], f"{output_path}_{i}.mp4")

return out
# outputs = []
# for i in range(n):
# output = pipe(
# prompt=task,
# guidance_scale=guidance_scale,
# num_inference_steps=inference_steps,
# )
# outputs.append(output)
# if output_type == ".gif":
# out = export_to_gif([output], f"{output_path}_{i}.gif")
# else:
# out = export_to_video([output], f"{output_path}_{i}.mp4")
output = pipe(
prompt = task,
guidance_scale = guidance_scale,
num_inference_steps = inference_steps
)
output = export_to_gif(output.frames[0], output_path)
return output


@app.post("/v1/chat/completions", response_model=TextToVideoResponse)
Expand Down

0 comments on commit 0dea8d6

Please sign in to comment.