besarismaili commited on
Commit
abfd2c7
·
1 Parent(s): d5d86d7
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -45,12 +45,10 @@ def anim(f_promt, s_promt, stability_key):
45
 
46
  # Render each frame of animation
47
  for idx, frame in enumerate(animator.render()):
48
- # Convert PIL Image to base64
49
- buffered = io.BytesIO()
50
- frame.save(buffered, format="PNG")
51
- img_str = base64.b64encode(buffered.getvalue()).decode()
52
- yield img_str # Yield the base64 string of the generated frame
53
-
54
  with gr.Blocks() as demo:
55
  gr.Markdown("Stability Animation")
56
  f_promt = gr.Textbox(label="First Prompt", value="a photo of a cute cat")
 
45
 
46
  # Render each frame of animation
47
  for idx, frame in enumerate(animator.render()):
48
+ file_path = f"frame_{idx:05d}.png"
49
+ frame.save(".output/"+file_path)
50
+ yield file_path # Yield the path to the generated frame
51
+
 
 
52
  with gr.Blocks() as demo:
53
  gr.Markdown("Stability Animation")
54
  f_promt = gr.Textbox(label="First Prompt", value="a photo of a cute cat")