Update app.py
Browse files
app.py
CHANGED
|
@@ -11,14 +11,6 @@
|
|
| 11 |
# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
# // See the License for the specific language governing permissions and
|
| 13 |
# // limitations under the License.
|
| 14 |
-
import spaces
|
| 15 |
-
import subprocess
|
| 16 |
-
|
| 17 |
-
# Clone the repository to ensure all files are available
|
| 18 |
-
subprocess.run("git lfs install", shell=True, check=True)
|
| 19 |
-
subprocess.run("git clone https://huggingface.co/spaces/ByteDance-Seed/SeedVR2-3B", shell=True, check=True)
|
| 20 |
-
os.chdir('SeedVR2-3B')
|
| 21 |
-
|
| 22 |
|
| 23 |
import os
|
| 24 |
import torch
|
|
@@ -107,7 +99,7 @@ def configure_runner(sp_size):
|
|
| 107 |
runner.vae.set_memory_limit(**runner.config.vae.memory_limit)
|
| 108 |
return runner
|
| 109 |
|
| 110 |
-
|
| 111 |
def generation_step(runner, text_embeds_dict, cond_latents):
|
| 112 |
def _move_to_cuda(x):
|
| 113 |
return [i.to(torch.device("cuda")) for i in x]
|
|
@@ -164,7 +156,7 @@ def generation_step(runner, text_embeds_dict, cond_latents):
|
|
| 164 |
|
| 165 |
return samples
|
| 166 |
|
| 167 |
-
|
| 168 |
def generation_loop(video_path='./test_videos', seed=666, fps_out=12, batch_size=1, cfg_scale=1.0, cfg_rescale=0.0, sample_steps=1, res_h=1280, res_w=720, sp_size=1):
|
| 169 |
runner = configure_runner(1)
|
| 170 |
|
|
|
|
| 11 |
# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
# // See the License for the specific language governing permissions and
|
| 13 |
# // limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
import os
|
| 16 |
import torch
|
|
|
|
| 99 |
runner.vae.set_memory_limit(**runner.config.vae.memory_limit)
|
| 100 |
return runner
|
| 101 |
|
| 102 |
+
@torch.no_grad()
|
| 103 |
def generation_step(runner, text_embeds_dict, cond_latents):
|
| 104 |
def _move_to_cuda(x):
|
| 105 |
return [i.to(torch.device("cuda")) for i in x]
|
|
|
|
| 156 |
|
| 157 |
return samples
|
| 158 |
|
| 159 |
+
@torch.no_grad()
|
| 160 |
def generation_loop(video_path='./test_videos', seed=666, fps_out=12, batch_size=1, cfg_scale=1.0, cfg_rescale=0.0, sample_steps=1, res_h=1280, res_w=720, sp_size=1):
|
| 161 |
runner = configure_runner(1)
|
| 162 |
|