Spaces:
Runtime error
Runtime error
experiment
Browse files- .idea/.gitignore +3 -0
- .idea/GenVideo.iml +8 -0
- .idea/inspectionProfiles/Project_Default.xml +207 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +7 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- app.py +48 -0
.idea/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# Default ignored files
|
2 |
+
/shelf/
|
3 |
+
/workspace.xml
|
.idea/GenVideo.iml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="inheritedJdk" />
|
6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
+
</component>
|
8 |
+
</module>
|
.idea/inspectionProfiles/Project_Default.xml
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<profile version="1.0">
|
3 |
+
<option name="myName" value="Project Default" />
|
4 |
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
5 |
+
<option name="ignoredPackages">
|
6 |
+
<value>
|
7 |
+
<list size="187">
|
8 |
+
<item index="0" class="java.lang.String" itemvalue="importlib-metadata" />
|
9 |
+
<item index="1" class="java.lang.String" itemvalue="chromadb" />
|
10 |
+
<item index="2" class="java.lang.String" itemvalue="tzlocal" />
|
11 |
+
<item index="3" class="java.lang.String" itemvalue="scikit-learn" />
|
12 |
+
<item index="4" class="java.lang.String" itemvalue="tabulate" />
|
13 |
+
<item index="5" class="java.lang.String" itemvalue="opentelemetry-proto" />
|
14 |
+
<item index="6" class="java.lang.String" itemvalue="validators" />
|
15 |
+
<item index="7" class="java.lang.String" itemvalue="ufw" />
|
16 |
+
<item index="8" class="java.lang.String" itemvalue="pyth" />
|
17 |
+
<item index="9" class="java.lang.String" itemvalue="pycairo" />
|
18 |
+
<item index="10" class="java.lang.String" itemvalue="pycparser" />
|
19 |
+
<item index="11" class="java.lang.String" itemvalue="cmdtest" />
|
20 |
+
<item index="12" class="java.lang.String" itemvalue="PyGObject" />
|
21 |
+
<item index="13" class="java.lang.String" itemvalue="posthog" />
|
22 |
+
<item index="14" class="java.lang.String" itemvalue="distro-info" />
|
23 |
+
<item index="15" class="java.lang.String" itemvalue="pyasn1-modules" />
|
24 |
+
<item index="16" class="java.lang.String" itemvalue="systemd-python" />
|
25 |
+
<item index="17" class="java.lang.String" itemvalue="cliapp" />
|
26 |
+
<item index="18" class="java.lang.String" itemvalue="language-selector" />
|
27 |
+
<item index="19" class="java.lang.String" itemvalue="uvicorn" />
|
28 |
+
<item index="20" class="java.lang.String" itemvalue="pysimdjson" />
|
29 |
+
<item index="21" class="java.lang.String" itemvalue="terminado" />
|
30 |
+
<item index="22" class="java.lang.String" itemvalue="pydantic" />
|
31 |
+
<item index="23" class="java.lang.String" itemvalue="Werkzeug" />
|
32 |
+
<item index="24" class="java.lang.String" itemvalue="pyglet" />
|
33 |
+
<item index="25" class="java.lang.String" itemvalue="streamlit" />
|
34 |
+
<item index="26" class="java.lang.String" itemvalue="opentelemetry-api" />
|
35 |
+
<item index="27" class="java.lang.String" itemvalue="pinecone-client" />
|
36 |
+
<item index="28" class="java.lang.String" itemvalue="reportlab" />
|
37 |
+
<item index="29" class="java.lang.String" itemvalue="PyMuPDFb" />
|
38 |
+
<item index="30" class="java.lang.String" itemvalue="pexpect" />
|
39 |
+
<item index="31" class="java.lang.String" itemvalue="pypdf" />
|
40 |
+
<item index="32" class="java.lang.String" itemvalue="python-apt" />
|
41 |
+
<item index="33" class="java.lang.String" itemvalue="SecretStorage" />
|
42 |
+
<item index="34" class="java.lang.String" itemvalue="ubuntu-advantage-tools" />
|
43 |
+
<item index="35" class="java.lang.String" itemvalue="opentelemetry-util-http" />
|
44 |
+
<item index="36" class="java.lang.String" itemvalue="psutil" />
|
45 |
+
<item index="37" class="java.lang.String" itemvalue="openai" />
|
46 |
+
<item index="38" class="java.lang.String" itemvalue="pyxdg" />
|
47 |
+
<item index="39" class="java.lang.String" itemvalue="nvidia-cublas-cu12" />
|
48 |
+
<item index="40" class="java.lang.String" itemvalue="paramiko" />
|
49 |
+
<item index="41" class="java.lang.String" itemvalue="pydantic_core" />
|
50 |
+
<item index="42" class="java.lang.String" itemvalue="platformdirs" />
|
51 |
+
<item index="43" class="java.lang.String" itemvalue="referencing" />
|
52 |
+
<item index="44" class="java.lang.String" itemvalue="PyJWT" />
|
53 |
+
<item index="45" class="java.lang.String" itemvalue="netifaces" />
|
54 |
+
<item index="46" class="java.lang.String" itemvalue="nvidia-nvjitlink-cu12" />
|
55 |
+
<item index="47" class="java.lang.String" itemvalue="nvidia-cusparse-cu12" />
|
56 |
+
<item index="48" class="java.lang.String" itemvalue="pandocfilters" />
|
57 |
+
<item index="49" class="java.lang.String" itemvalue="py4j" />
|
58 |
+
<item index="50" class="java.lang.String" itemvalue="pyasn1" />
|
59 |
+
<item index="51" class="java.lang.String" itemvalue="jupyter-events" />
|
60 |
+
<item index="52" class="java.lang.String" itemvalue="nvidia-nccl-cu12" />
|
61 |
+
<item index="53" class="java.lang.String" itemvalue="sniffio" />
|
62 |
+
<item index="54" class="java.lang.String" itemvalue="websocket-client" />
|
63 |
+
<item index="55" class="java.lang.String" itemvalue="seaborn" />
|
64 |
+
<item index="56" class="java.lang.String" itemvalue="zipp" />
|
65 |
+
<item index="57" class="java.lang.String" itemvalue="prompt-toolkit" />
|
66 |
+
<item index="58" class="java.lang.String" itemvalue="xgboost" />
|
67 |
+
<item index="59" class="java.lang.String" itemvalue="together" />
|
68 |
+
<item index="60" class="java.lang.String" itemvalue="websockets" />
|
69 |
+
<item index="61" class="java.lang.String" itemvalue="pyarrow" />
|
70 |
+
<item index="62" class="java.lang.String" itemvalue="PyOpenGL" />
|
71 |
+
<item index="63" class="java.lang.String" itemvalue="ubuntu-drivers-common" />
|
72 |
+
<item index="64" class="java.lang.String" itemvalue="PyMuPDF" />
|
73 |
+
<item index="65" class="java.lang.String" itemvalue="scipy" />
|
74 |
+
<item index="66" class="java.lang.String" itemvalue="watchfiles" />
|
75 |
+
<item index="67" class="java.lang.String" itemvalue="tornado" />
|
76 |
+
<item index="68" class="java.lang.String" itemvalue="xkit" />
|
77 |
+
<item index="69" class="java.lang.String" itemvalue="nvidia-cudnn-cu12" />
|
78 |
+
<item index="70" class="java.lang.String" itemvalue="torch" />
|
79 |
+
<item index="71" class="java.lang.String" itemvalue="overrides" />
|
80 |
+
<item index="72" class="java.lang.String" itemvalue="toml" />
|
81 |
+
<item index="73" class="java.lang.String" itemvalue="opentelemetry-semantic-conventions" />
|
82 |
+
<item index="74" class="java.lang.String" itemvalue="pandas" />
|
83 |
+
<item index="75" class="java.lang.String" itemvalue="watchdog" />
|
84 |
+
<item index="76" class="java.lang.String" itemvalue="typing_extensions" />
|
85 |
+
<item index="77" class="java.lang.String" itemvalue="dbus-python" />
|
86 |
+
<item index="78" class="java.lang.String" itemvalue="olefile" />
|
87 |
+
<item index="79" class="java.lang.String" itemvalue="usb-creator" />
|
88 |
+
<item index="80" class="java.lang.String" itemvalue="opentelemetry-instrumentation" />
|
89 |
+
<item index="81" class="java.lang.String" itemvalue="traitlets" />
|
90 |
+
<item index="82" class="java.lang.String" itemvalue="protobuf" />
|
91 |
+
<item index="83" class="java.lang.String" itemvalue="ttystatus" />
|
92 |
+
<item index="84" class="java.lang.String" itemvalue="pygame" />
|
93 |
+
<item index="85" class="java.lang.String" itemvalue="threadpoolctl" />
|
94 |
+
<item index="86" class="java.lang.String" itemvalue="Brlapi" />
|
95 |
+
<item index="87" class="java.lang.String" itemvalue="duplicity" />
|
96 |
+
<item index="88" class="java.lang.String" itemvalue="python-dateutil" />
|
97 |
+
<item index="89" class="java.lang.String" itemvalue="roman" />
|
98 |
+
<item index="90" class="java.lang.String" itemvalue="pycups" />
|
99 |
+
<item index="91" class="java.lang.String" itemvalue="python-dotenv" />
|
100 |
+
<item index="92" class="java.lang.String" itemvalue="gym-maze" />
|
101 |
+
<item index="93" class="java.lang.String" itemvalue="PyPika" />
|
102 |
+
<item index="94" class="java.lang.String" itemvalue="nvidia-cusolver-cu12" />
|
103 |
+
<item index="95" class="java.lang.String" itemvalue="pyzmq" />
|
104 |
+
<item index="96" class="java.lang.String" itemvalue="polars" />
|
105 |
+
<item index="97" class="java.lang.String" itemvalue="pyparsing" />
|
106 |
+
<item index="98" class="java.lang.String" itemvalue="unattended-upgrades" />
|
107 |
+
<item index="99" class="java.lang.String" itemvalue="opentelemetry-instrumentation-asgi" />
|
108 |
+
<item index="100" class="java.lang.String" itemvalue="sympy" />
|
109 |
+
<item index="101" class="java.lang.String" itemvalue="uvloop" />
|
110 |
+
<item index="102" class="java.lang.String" itemvalue="triton" />
|
111 |
+
<item index="103" class="java.lang.String" itemvalue="setuptools-git" />
|
112 |
+
<item index="104" class="java.lang.String" itemvalue="opentelemetry-exporter-otlp-proto-grpc" />
|
113 |
+
<item index="105" class="java.lang.String" itemvalue="pulsar-client" />
|
114 |
+
<item index="106" class="java.lang.String" itemvalue="orjson" />
|
115 |
+
<item index="107" class="java.lang.String" itemvalue="opentelemetry-instrumentation-fastapi" />
|
116 |
+
<item index="108" class="java.lang.String" itemvalue="duckdb" />
|
117 |
+
<item index="109" class="java.lang.String" itemvalue="nvidia-nvtx-cu12" />
|
118 |
+
<item index="110" class="java.lang.String" itemvalue="streamlit-float" />
|
119 |
+
<item index="111" class="java.lang.String" itemvalue="widgetsnbextension" />
|
120 |
+
<item index="112" class="java.lang.String" itemvalue="gyp" />
|
121 |
+
<item index="113" class="java.lang.String" itemvalue="pyautogen" />
|
122 |
+
<item index="114" class="java.lang.String" itemvalue="webargs" />
|
123 |
+
<item index="115" class="java.lang.String" itemvalue="whatsapp-python" />
|
124 |
+
<item index="116" class="java.lang.String" itemvalue="miniworld" />
|
125 |
+
<item index="117" class="java.lang.String" itemvalue="defer" />
|
126 |
+
<item index="118" class="java.lang.String" itemvalue="pydeck" />
|
127 |
+
<item index="119" class="java.lang.String" itemvalue="ptyprocess" />
|
128 |
+
<item index="120" class="java.lang.String" itemvalue="SQLAlchemy" />
|
129 |
+
<item index="121" class="java.lang.String" itemvalue="opentelemetry-sdk" />
|
130 |
+
<item index="122" class="java.lang.String" itemvalue="pyspark" />
|
131 |
+
<item index="123" class="java.lang.String" itemvalue="wcwidth" />
|
132 |
+
<item index="124" class="java.lang.String" itemvalue="types-python-dateutil" />
|
133 |
+
<item index="125" class="java.lang.String" itemvalue="python-debian" />
|
134 |
+
<item index="126" class="java.lang.String" itemvalue="cupshelpers" />
|
135 |
+
<item index="127" class="java.lang.String" itemvalue="onnxruntime" />
|
136 |
+
<item index="128" class="java.lang.String" itemvalue="chroma-hnswlib" />
|
137 |
+
<item index="129" class="java.lang.String" itemvalue="rpds-py" />
|
138 |
+
<item index="130" class="java.lang.String" itemvalue="tomli" />
|
139 |
+
<item index="131" class="java.lang.String" itemvalue="louis" />
|
140 |
+
<item index="132" class="java.lang.String" itemvalue="urllib3" />
|
141 |
+
<item index="133" class="java.lang.String" itemvalue="faiss-gpu" />
|
142 |
+
<item index="134" class="java.lang.String" itemvalue="sseclient-py" />
|
143 |
+
<item index="135" class="java.lang.String" itemvalue="typer" />
|
144 |
+
<item index="136" class="java.lang.String" itemvalue="pandasai" />
|
145 |
+
<item index="137" class="java.lang.String" itemvalue="parso" />
|
146 |
+
<item index="138" class="java.lang.String" itemvalue="prometheus-client" />
|
147 |
+
<item index="139" class="java.lang.String" itemvalue="pyth3" />
|
148 |
+
<item index="140" class="java.lang.String" itemvalue="pillow" />
|
149 |
+
<item index="141" class="java.lang.String" itemvalue="xdg" />
|
150 |
+
<item index="142" class="java.lang.String" itemvalue="command-not-found" />
|
151 |
+
<item index="143" class="java.lang.String" itemvalue="opentelemetry-exporter-otlp-proto-common" />
|
152 |
+
<item index="144" class="java.lang.String" itemvalue="accelerate" />
|
153 |
+
<item index="145" class="java.lang.String" itemvalue="diffusers" />
|
154 |
+
<item index="146" class="java.lang.String" itemvalue="gradio" />
|
155 |
+
<item index="147" class="java.lang.String" itemvalue="huggingface-hub" />
|
156 |
+
<item index="148" class="java.lang.String" itemvalue="PyYAML" />
|
157 |
+
<item index="149" class="java.lang.String" itemvalue="MarkupSafe" />
|
158 |
+
<item index="150" class="java.lang.String" itemvalue="requests" />
|
159 |
+
<item index="151" class="java.lang.String" itemvalue="Jinja2" />
|
160 |
+
<item index="152" class="java.lang.String" itemvalue="markdown-it-py" />
|
161 |
+
<item index="153" class="java.lang.String" itemvalue="fsspec" />
|
162 |
+
<item index="154" class="java.lang.String" itemvalue="jsonschema-specifications" />
|
163 |
+
<item index="155" class="java.lang.String" itemvalue="semantic-version" />
|
164 |
+
<item index="156" class="java.lang.String" itemvalue="tomlkit" />
|
165 |
+
<item index="157" class="java.lang.String" itemvalue="filelock" />
|
166 |
+
<item index="158" class="java.lang.String" itemvalue="gradio_client" />
|
167 |
+
<item index="159" class="java.lang.String" itemvalue="Pygments" />
|
168 |
+
<item index="160" class="java.lang.String" itemvalue="safetensors" />
|
169 |
+
<item index="161" class="java.lang.String" itemvalue="starlette" />
|
170 |
+
<item index="162" class="java.lang.String" itemvalue="mdurl" />
|
171 |
+
<item index="163" class="java.lang.String" itemvalue="jsonschema" />
|
172 |
+
<item index="164" class="java.lang.String" itemvalue="tokenizers" />
|
173 |
+
<item index="165" class="java.lang.String" itemvalue="transformers" />
|
174 |
+
<item index="166" class="java.lang.String" itemvalue="importlib_resources" />
|
175 |
+
<item index="167" class="java.lang.String" itemvalue="aiofiles" />
|
176 |
+
<item index="168" class="java.lang.String" itemvalue="rich" />
|
177 |
+
<item index="169" class="java.lang.String" itemvalue="pydub" />
|
178 |
+
<item index="170" class="java.lang.String" itemvalue="python-multipart" />
|
179 |
+
<item index="171" class="java.lang.String" itemvalue="click" />
|
180 |
+
<item index="172" class="java.lang.String" itemvalue="altair" />
|
181 |
+
<item index="173" class="java.lang.String" itemvalue="attrs" />
|
182 |
+
<item index="174" class="java.lang.String" itemvalue="fastapi" />
|
183 |
+
<item index="175" class="java.lang.String" itemvalue="regex" />
|
184 |
+
<item index="176" class="java.lang.String" itemvalue="toolz" />
|
185 |
+
<item index="177" class="java.lang.String" itemvalue="ruff" />
|
186 |
+
<item index="178" class="java.lang.String" itemvalue="charset-normalizer" />
|
187 |
+
<item index="179" class="java.lang.String" itemvalue="ffmpy" />
|
188 |
+
<item index="180" class="java.lang.String" itemvalue="shellingham" />
|
189 |
+
<item index="181" class="java.lang.String" itemvalue="langchain" />
|
190 |
+
<item index="182" class="java.lang.String" itemvalue="sentence-transformers" />
|
191 |
+
<item index="183" class="java.lang.String" itemvalue="Pillow" />
|
192 |
+
<item index="184" class="java.lang.String" itemvalue="langchain-text-splitters" />
|
193 |
+
<item index="185" class="java.lang.String" itemvalue="langchain_core" />
|
194 |
+
<item index="186" class="java.lang.String" itemvalue="langchain_community" />
|
195 |
+
</list>
|
196 |
+
</value>
|
197 |
+
</option>
|
198 |
+
</inspection_tool>
|
199 |
+
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
200 |
+
<option name="ignoredIdentifiers">
|
201 |
+
<list>
|
202 |
+
<option value="spaces" />
|
203 |
+
</list>
|
204 |
+
</option>
|
205 |
+
</inspection_tool>
|
206 |
+
</profile>
|
207 |
+
</component>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="Black">
|
4 |
+
<option name="sdkName" value="Python 3.12" />
|
5 |
+
</component>
|
6 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
7 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/GenVideo.iml" filepath="$PROJECT_DIR$/.idea/GenVideo.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
app.py
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import torch
|
3 |
+
from diffusers import AnimateDiffPipeline, DDIMScheduler, MotionAdapter
|
4 |
+
from diffusers.utils import export_to_gif
|
5 |
+
from diffusers.utils import export_to_video
|
6 |
+
import uuid
|
7 |
+
import spaces
|
8 |
+
|
9 |
+
device = "cuda"
|
10 |
+
adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16)
|
11 |
+
model_id = "SG161222/Realistic_Vision_V5.1_noVAE"
|
12 |
+
pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16).to(device)
|
13 |
+
scheduler = DDIMScheduler.from_pretrained(
|
14 |
+
model_id,
|
15 |
+
subfolder="scheduler",
|
16 |
+
clip_sample=False,
|
17 |
+
timestep_spacing="linspace",
|
18 |
+
beta_schedule="linear",
|
19 |
+
steps_offset=1,
|
20 |
+
)
|
21 |
+
pipe.scheduler = scheduler
|
22 |
+
|
23 |
+
# enable memory savings
|
24 |
+
pipe.enable_vae_slicing()
|
25 |
+
pipe.enable_model_cpu_offload()
|
26 |
+
@spaces.GPU
|
27 |
+
def generate(prompt):
|
28 |
+
pipe.to(device)
|
29 |
+
output = pipe(
|
30 |
+
prompt=prompt,
|
31 |
+
negative_prompt="bad quality, worse quality",
|
32 |
+
num_frames=16,
|
33 |
+
guidance_scale=7.5,
|
34 |
+
num_inference_steps=4,
|
35 |
+
)
|
36 |
+
|
37 |
+
name = str(uuid.uuid4()).replace("-", "")
|
38 |
+
path = f"/tmp/{name}.mp4"
|
39 |
+
export_to_video(output.frames[0], path, fps=10)
|
40 |
+
return path
|
41 |
+
|
42 |
+
iface = gr.Interface(
|
43 |
+
fn=generate,
|
44 |
+
inputs=gr.Textbox(label="Enter your prompt"),
|
45 |
+
outputs=gr.Video(label="Generated Video"),
|
46 |
+
)
|
47 |
+
|
48 |
+
iface.launch()
|