File size: 550 Bytes
7fab996
 
7f53786
7fab996
 
 
 
 
 
 
 
 
7f53786
7fab996
7f53786
7fab996
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
import replicate
from urllib.request import urlretrieve

def story2video(story_text, story_frames, auth_replicate):
    os.environ["REPLICATE_API_TOKEN"] = auth_replicate

    output = replicate.run(
        "deforum/deforum_stable_diffusion:e22e77495f2fb83c34d5fae2ad8ab63c0a87b6b573b6208e1535b23b89ea66d6",
        input={"max_frames": story_frames,
               "model_checkpoint": "Protogen_V2.2.ckpt","animation_prompts": story_text,
               "fps": 10
        }
    )
    urlretrieve(output, 'video_out.mp4')
    return output