-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreload.py
100 lines (94 loc) · 13.6 KB
/
preload.py
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import os
import sys
# Define the requirements for the extension
REQUIRED_PACKAGES = [
"gradio>=3.10.1",
"transparent-background==1.3.2",
"torch>=1.9.0",
"Pillow",
]
ASCII_ART = """
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡟⣯⡿⣝⣯⠿⣽⢯⣟⡿⣻⣟⣿⣿⣿⢿⣿⣿⣿⣿⣻⣿⣶⣾⣷⣬⡁⠈⢀⣀⣵⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡰⢌
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⢯⣽⢯⣟⢾⣵⣻⡽⣾⡽⣽⣳⢯⣟⣿⣿⣯⣿⢾⣿⣿⣟⡾⣯⢿⣿⣿⣿⣷⣤⣿⡇⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠠⠁⠊⠀⠁⠀⠀⠀⠀⠀⠂⠘⠂
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣏⣿⢯⣿⢾⣟⡾⣳⣟⣳⣟⡷⣯⣟⣾⣿⣿⣿⢾⣿⣟⡾⣿⣿⣽⣿⣿⣏⣿⣿⣿⣿⣷⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⡳⣞⣿⣿⡯⣿⢾⣽⣳⢯⡷⣯⣟⣷⣻⣽⣿⣿⣿⣿⡽⣯⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⢀⣀⣄⡀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⢯⣗⣻⣿⣟⡾⣽⢿⣛⣾⡽⣯⢟⣷⣻⢾⣽⣿⣿⣞⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⣀⣀⣠⣶⠿⣻⠿⠛⢹⣿⢿⠟⠛⠉⠐⣌⢻⡀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡿⣝⣾⣿⡟⣼⣻⣏⣿⣹⢺⣟⣵⣫⣶⡿⣾⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡄⢀⣠⣴⡾⢋⣽⣿⣯⣿⠋⡔⠉⣼⣿⠇⠀⠀⠀⠣⢌⣻⠇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡿⣽⣿⣟⢾⣿⡵⣯⢾⣱⣯⣿⣷⢯⣷⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣴⣿⣿⣿⣿⠃⢌⠀⢰⣿⡏⠀⠀⠀⠀⠱⢨⠼⡇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣻⣿⣿⣯⢿⣿⣟⣯⣿⣯⣿⣿⣿⣯⣿⣟⣿⣿⣳⣿⣿⣿⣈⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢳⣿⢣⠘⣀⡞⢸⣿⠁⠀⠀⠀⠀⢀⠃⢾⠁⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣻⣽⣿⣿⣯⢿⣿⣻⣾⢿⣿⣽⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣭⣴⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣧⣿⢋⢆⠃⣾⠀⣸⡟⠀⠀⠀⠀⠀⠀⠎⡽⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣾⡟⣽⣿⣿⣿⣯⣿⣿⣏⣿⣿⢿⣿⣧⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⡟⢯⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⡿⢿⡿⢣⢍⣢⣭⡇⢀⣿⢃⠀⠀⠀⠀⠀⢈⢒⡇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣼⡟⢰⣿⢾⣿⣯⣷⣿⣿⣿⣞⣿⣿⣿⣿⣦⣛⢿⣿⣿⣿⣿⣿⣿⣽⠏⠉⠗⣚⣩⣾⠟⣭⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣿⣿⣿⣿⣷⣿⡏⢠⠃⢸⡟⠰⠀⠀⠀⠀⠀⢌⣺⠁⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢰⡿⠀⣾⡏⣿⣿⡷⣿⣿⣿⣿⣧⣧⣼⣿⣿⣿⣿⣶⡹⢿⣿⣿⣿⣿⡸⢄⠉⠉⡙⣉⠡⣚⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⣿⣿⣇⡞⠀⣼⠁⠁⠀⠀⠀⠀⠈⡴⡇⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣿⠁⢸⡟⠀⣿⣯⣿⣿⣿⣿⣿⣿⣿⣿⣟⠻⢾⣫⣼⠗⠀⠙⢟⡻⣿⣷⡂⠀⠀⠐⠀⠂⢡⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⣿⣿⣿⠃⣿⣿⠟⠀⢠⡇⠀⠀⠀⠀⠀⠀⣘⡾⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢸⡇⢀⣿⠁⠀⣿⣿⣳⣿⣿⣿⣿⣿⣿⣿⣬⠉⡒⠋⠁⠀⠀⠀⣤⠙⠌⠻⢆⡀⠀⠀⢀⣰⡿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢸⣿⠋⠀⠀⣸⠁⠀⠀⠀⠀⠀⠐⣼⠁⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢸⢀⣾⠏⠀⢰⡿⣿⣳⣿⣿⣿⣿⣿⣿⣿⣿⣷⣌⢡⣁⡀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠤⠚⢱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⣸⠇⠀⠀⢠⠇⠀⠀⠀⠀⠀⢀⣹⡏⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣿⣾⠟⠀⢀⣾⣟⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡻⢎⣀⣀⠄⠀⠀⣤⣠⣤⡀⠀⠀⠀⣠⡿⣿⣿⣿⣿⣿⡟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⠏⠀⠀⢠⠏⠀⠀⠀⠀⠀⠠⣜⡾⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⣟⡞⠀⠀⣼⣿⣞⡿⣾⣿⣾⢿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⣀⠀⠀⠀⠀⠉⠉⠀⠀⢀⡼⢏⣵⣿⣿⣿⡟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠣⠋⠀⢀⣴⠏⠀⡄⠀⠀⠀⣀⢳⡞⠀⢿⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣴⣟⣷⣇⢀⣼⠏⢸⢾⡿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣿⡲⢤⣄⣀⣠⠖⣏⣱⣾⣿⣿⣿⣿⠇⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠓⢶⣾⠟⠁⠀⡜⠀⠀⠀⡰⣬⠟⠀⠀⠘⣧⠀⠀⠀⠀⠀⠀
⠀⢠⣾⡳⠋⢸⢾⡾⡟⠀⣾⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢷⣃⢎⠲⣁⠏⣴⣿⡿⢻⢽⣿⣿⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⢃⠈⣆⠀⠀⠀⣠⠞⠀⠀⢀⡰⣳⠋⠀⠀⠀⠀⠘⠆⠀⠀⠀⠀⠀
⣰⣻⠞⠀⢀⣼⣿⣿⠀⢰⣟⣾⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢋⡜⣻⣆⠣⠜⡒⢼⡿⣈⠗⣚⣏⠿⣼⣿⡿⣿⣿⣿⢿⣙⢮⡿⠃⠀⠈⠒⠶⠾⠋⠀⠀⢀⢦⡟⠁⠀⠀⠀⠀⠀⠀⠈⢆⠀⠀⠀⠀
⡗⠁⠀⣠⡾⢃⣽⡾⣧⡾⣽⣯⣿⣿⣿⣿⣿⡿⠻⠿⠿⣿⣿⣿⣿⣿⣿⣯⣇⠎⡴⢡⢎⠳⡜⢺⣄⢛⣦⢙⡴⢪⠜⣆⣛⣷⣿⣿⣟⢣⠎⠻⠁⠀⠀⠀⠀⠀⠀⠀⠀⡄⣯⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣧⠀⠀⠀
⠀⢀⣾⢋⣴⠟⠁⠻⣽⡿⣿⣾⣿⣿⡟⠉⠉⢿⣄⠀⡸⠛⢉⠛⣿⣿⣿⣷⣮⣛⠍⠲⢌⠣⡜⡄⠛⡷⢏⠲⡌⣧⣻⠞⣋⢶⣿⣿⣏⠆⠁⠀⠀⠀⠀⠀⠀⠀⠀⡄⣳⣾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⠀⠀
⣴⣿⣵⠟⠁⠀⢀⣼⣿⣿⢷⣿⣿⡟⠀⠀⠀⠀⠙⣏⠀⠁⢢⡀⠸⣿⣿⣿⣿⠿⣿⣷⡾⠶⢶⣌⢓⡰⢊⣕⡾⢛⠤⡙⡔⢺⣿⢿⣿⠀⠀⠀⠀⠀⠀⠀⠀⡄⣣⣼⡏⢽⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣧⠀⠀
⠟⢏⠀⠀⠀⢀⣾⣿⣟⣿⣿⣿⣿⡁⠀⠀⠀⠀⠀⠸⡄⠀⠀⠈⠂⣿⣿⣿⣿⣿⣷⣤⡙⣷⣬⡘⠳⠐⢃⠌⡰⢉⠆⡱⢈⣽⣿⡎⢿⡆⠰⣇⠀⡀⢄⠢⣍⣶⣿⣿⡅⢺⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡿⠀⠀
⠀⠀⠉⠒⢀⡾⠛⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⢠⣿⣿⣿⣇⢻⣿⣿⢿⣾⣿⣷⠀⠁⠂⠌⢀⠁⠂⠁⢰⣿⣿⣷⡈⢻⡄⢹⡖⣈⠦⡿⣾⣿⣿⣿⣿⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣟⠀⠀
⡰⢪⡕⡴⠃⢠⣾⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠈⢿⣄⡀⣼⣿⠟⣹⠇⠀⢿⣿⠀⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠘⠆⣻⣿⣿⣦⣽⣾⣧⣝⣾⣷⢻⣿⣿⣿⣿⣷⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠇⠀⠀
⢡⣣⠞⠀⣰⣿⣿⢋⣿⣿⣿⣿⡷⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⡿⠟⠊⠁⠀⣠⣿⣏⣾⣿⣾⡿⢿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⡞⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⠀⠀⠀
⠚⠁⠀⢀⣿⣷⠏⣼⣿⣿⣿⣿⣟⠀⠀⠀⠀⠀⠀⢀⣠⣶⢿⡟⠀⠀⢀⠄⢊⣿⣿⣿⣿⠟⠛⠉⠁⠀⠀⠰⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⢿⣿⣿⣷⡀⠀⠀⠀⠀⠒⠛⠛⠁⠀⠀⠀⠀
⠀⠀⢀⣼⣿⣟⣴⣿⣿⣿⣿⣿⡏⠀⠀⠀⣀⣤⣾⣿⠟⣉⢾⠇⠀⠐⣁⢶⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠙⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⣿⡆⠈⢻⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣠⣾⣟⣾⣿⣿⣿⣿⣿⣿⣿⠇⢀⣤⠾⠛⠋⠁⠀⠈⡔⣾⠖⢀⠜⣠⡾⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢙⢄⡀⠻⣿⠙⠳⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀
⡴⣟⡷⣯⣿⢿⣿⣿⡿⣿⣿⣿⡴⠋⠀⠀⠀⠀⠀⠀⠐⣸⡿⠀⠘⡶⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠲⢿⣷⡀⠀⠻⡷⣄⠀⠀⠀⠀⠀⠀
⡸⠋⠉⠙⢣⣿⣿⣿⣇⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⢰⡿⠁⠀⢰⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡝⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡖⣦⡘⣧⡀⠀⠉⢌⠳⡀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⣿⢾⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠁⠀⠀⠘⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⣿⠌⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠓⡛⠁⢣⠀⠀⠀⠡⡘⢆⠀⠀⠀
⣦⣀⣀⣤⢾⣿⣻⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⢸⠇⠀⠀⠀⠀⠀⠀⠀⠀⣠⢴⣲⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢽⡚⡌⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⠘⢸⠀⠀⠀⠀⠐⣌⡆⠀⠀
⢿⡟⠏⠻⢿⣷⣻⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠻⠟⠗⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢺⡝⡔⠁⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⣼⡇⠀⠀⠀⠀⢸⡷⠀⠀
⡏⠀⠀⠀⠀⠙⢿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠠⢁⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢾⡹⢬⡁⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡇⠀⠀⠀⢀⣾⣿⠀⠀
⢇⡀⠂⠀⠀⠀⠈⠙⠿⣯⠀⠀⠀⠀⠀⠀⢀⠑⡂⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡘⣽⡝⢦⡃⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣺⣿⣿⣷⣄⠀⢀⣾⣿⡇⠀⠀
⡄⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⣄⠀⠀⠀⠀⠠⢃⡕⢺⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡑⢼⡟⡼⣩⠿⣦⡡⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠰⣌⣷⣿⣿⣿⣿⣿⣶⣿⣿⣿⠁⠀⠀
⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⢐⡈⢳⡄⠀⢠⠡⢣⠜⣹⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢄⠣⣹⢾⡙⠶⡡⢞⡩⢷⣯⡰⠡⢄⠠⣀⠀⡄⢠⢂⡜⣬⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀
⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⡘⢄⢻⡄⢣⠜⣡⢞⣿⣿⣷⡆⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠘⢤⡷⢏⢧⡙⣣⠕⡪⠜⡡⢞⡹⠿⣮⣵⣦⣹⣬⣷⣾⣾⡙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀
⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠐⡈⢦⡙⢦⡙⢦⣻⢡⣿⣿⣿⣦⣐⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠰⣈⣦⢽⢫⠜⡩⢆⡱⢢⠙⠄⠃⠁⠊⠔⢫⠔⢦⠣⣝⢲⣿⠿⣿⡅⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀
⣿⣿⣿⣇⢤⠀⠀⠀⠀⠀⠀⠀⢈⠒⡜⢦⣹⣳⣿⣿⣿⣿⣿⡿⢠⣷⠶⢤⣤⣀⣀⣀⣄⣠⣤⣬⠶⢓⢋⠆⢣⠊⠌⠑⡀⠂⠁⠈⠀⠀⠀⠀⠈⠐⣊⠦⡙⢦⣿⣿⣨⣿⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀
⣿⣿⣿⣿⣿⣶⢄⡀⠀⠀⠀⠀⠠⢩⢜⣣⢷⢃⣿⣿⣿⣿⣿⣇⣿⣿⣧⠀⠀⠈⠉⠉⠈⠁⠀⠀⠐⠈⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠠⢎⣹⣿⣿⢿⣿⣿⢿⣿⣿⣿⣿⣿⣿⠙⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣧⣿⣦⣿⣥⣤⣀⣀⠂⡇⣞⣼⣿⣿⣿⣿⣿⢿⣿⣿⣿⡿⠛⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⣨⡿⢻⣿⣿⠏⠀⣸⣿⣿⣿⣿⣿⡿⠀⣿⢿⣿⣿⣿⣿⣿⣿
⡇⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠙⣾⣾⣿⣯⣿⣿⣿⣏⣼⡿⠛⠙⠁⠀⢹⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠱⣿⣿⣿⡿⣏⠀⣰⣿⣿⣿⣿⣿⣿⡇⠀⡿⢸⣿⣿⣿⣿⣿⣟
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⢰⣿⡿⠟⠛⢫⡹⠖⠉⠁⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⢻⣿⡿⢻⡇⠉⣹⣿⣿⣿⡟⣿⣿⡿⢀⣼⣡⣿⣿⣿⣿⣿⣿⣯
⡿⢿⠟⣿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣁⡤⠒⣠⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢲⣿⣿⡀⠘⢛⣿⣿⣿⣿⡟⢀⣿⣿⣅⣾⣿⣿⣿⣿⣿⣿⣿⣿⣧
⣿⣿⢰⣿⣿⣿⣿⣿⠛⢣⠐⢌⣖⠡⠔⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡰⠂⠀⠀⠀⠀⠀⠀⠀⠀⢨⡟⠙⢿⡿⠿⣻⣿⣿⣿⠟⣠⣿⡿⣻⣿⣿⢟⣋⣱⣿⣿⣿⣿⣿⣿
⣿⢿⢿⣿⣭⡿⠃⠄⠀⡠⠈⠸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠔⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⣹⣾⣿⣿⣿⣿⣾⠿⠋⠀⠹⡸⣏⡉⠉⣿⣿⣿⣿⣿⣿⠋
⡟⠁⢸⡾⠋⠀⢡⡤⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡾⢽⠂⢀⣼⣿⠟⠉⠉⠋⠉⠀⠀⠀⣆⣠⠇⠀⠀⣼⣿⣿⣿⣿⣿⣧⡀
⣇⠀⠋⠀⠀⠀⡺⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡃⢻⡇⢸⣿⢻⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠏⠉⠉
⣿⡀⠀⠀⠀⠠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠌⡑⣇⠘⣿⠈⢆⡀⠀⠀⠀⣀⠀⠀⣀⠤⣊⡽⢟⠿⠛⠉⠁⠐⠠⠀⠀
"""
def check_requirements():
"""Checks if all required packages are installed."""
missing_packages = []
for package in REQUIRED_PACKAGES:
try:
__import__(package.split("==")[0].split(">=")[0].strip())
except ImportError:
missing_packages.append(package)
if missing_packages:
print(f"\033[91m[!] Missing Required Packages:\033[0m {', '.join(missing_packages)}")
print("\033[93m[!] Please run the install.py script to resolve dependencies.\033[0m")
return False
return True
def colorful_welcome():
"""Displays a colorful welcome message for the extension."""
print("\033[95m" + "=" * 60)
print(" " * 12 + "✨ Welcome to the VFX Workflow Extension! ✨")
print("=" * 60 + "\033[0m")
print(ASCII_ART)
print("\033[94mThis extension provides a seamless video-to-frame processing workflow.\033[0m")
print("\033[92mFeatures include:\033[0m")
print(" ➡ Frame extraction with precise FPS handling.")
print(" ➡ Mask creation using advanced AI techniques.")
print(" ➡ Keyframe management with dynamic subfolder splitting.")
print(" ➡ Easy integration with Img2Img workflows.")
print(" ➡ Automatic generation of ZIP files and EBSynth configurations.\n")
print("\033[94mMake sure you have all required packages installed!\033[0m")
if __name__ == "__main__":
colorful_welcome()
if not check_requirements():
sys.exit("\033[91m[!] Please install missing dependencies using install.py.\033[0m")