-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-test.py
More file actions
64 lines (50 loc) · 1.1 KB
/
Copy pathmain-test.py
File metadata and controls
64 lines (50 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#import torch
#import gc
from time import sleep
from word import Post
from flux_quantized import Flux
from audio import AudioGenerator
from video import Video
#gc.collect()
#torch.cuda.empty_cache()
# word
# image prompts
# caption
# perhaps comment
# vlog script
my_post = Post(236)
my_post.choose()
print(my_post)
my_post.generate_text()
print("caption:")
print(my_post.caption+"\n")
print("comment:")
print(my_post.comment+"\n")
print("transcript:")
print(my_post.transcript+"\n")
my_post.save()
# flux
# images
sleep(3)
flux = Flux()
for i in range(my_post.len):
flux.generate_image(my_post.flux_prompts[i], f"images/{my_post.id}/{i}.png")
flux.clear_memory()
print("Generated images\n")
sleep(3)
# audio
# audio
audio_generator = AudioGenerator()
audio = audio_generator.run(my_post.transcript, "af_bella")
audio_generator.save(audio, f"images/{my_post.id}/audio.wav")
print(f"Generated audio\n")
# video
# reel_intro
# reel_main
# reel_total
vid = Video(my_post.id)
vid.render_intro()
vid.render_main()
vid.render_total()
print("Generated video\n")
# api-instagram