Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ from safetensors import safe_open
|
|
| 48 |
import json
|
| 49 |
import requests
|
| 50 |
|
| 51 |
-
from ltx_core.components.diffusion_steps import Res2sDiffusionStep
|
| 52 |
from ltx_core.components.guiders import MultiModalGuider, MultiModalGuiderParams
|
| 53 |
from ltx_core.components.noisers import GaussianNoiser
|
| 54 |
from ltx_core.components.protocols import DiffusionStepProtocol
|
|
@@ -62,6 +62,7 @@ from ltx_core.types import Audio, AudioLatentShape, VideoLatentShape, VideoPixel
|
|
| 62 |
from ltx_pipelines.distilled import DistilledPipeline
|
| 63 |
from ltx_pipelines.utils import (
|
| 64 |
res2s_audio_video_denoising_loop,
|
|
|
|
| 65 |
cleanup_memory,
|
| 66 |
encode_prompts,
|
| 67 |
denoise_audio_video,
|
|
@@ -238,6 +239,7 @@ class LTX23DistilledA2VPipeline:
|
|
| 238 |
generator = torch.Generator(device=self.device).manual_seed(seed)
|
| 239 |
noiser = GaussianNoiser(generator=generator)
|
| 240 |
stepper = Res2sDiffusionStep()
|
|
|
|
| 241 |
dtype = torch.bfloat16
|
| 242 |
|
| 243 |
ctx_p, ctx_n = encode_prompts(
|
|
@@ -311,11 +313,11 @@ class LTX23DistilledA2VPipeline:
|
|
| 311 |
)
|
| 312 |
|
| 313 |
def stage2_denoising_loop(sigmas: torch.Tensor, video_state, audio_state, stepper: DiffusionStepProtocol):
|
| 314 |
-
return
|
| 315 |
sigmas=sigmas,
|
| 316 |
video_state=video_state,
|
| 317 |
audio_state=audio_state,
|
| 318 |
-
stepper=
|
| 319 |
denoise_fn=simple_denoising_func(
|
| 320 |
video_context=v_context_p,
|
| 321 |
audio_context=a_context_p,
|
|
|
|
| 48 |
import json
|
| 49 |
import requests
|
| 50 |
|
| 51 |
+
from ltx_core.components.diffusion_steps import Res2sDiffusionStep, EulerDiffusionStep
|
| 52 |
from ltx_core.components.guiders import MultiModalGuider, MultiModalGuiderParams
|
| 53 |
from ltx_core.components.noisers import GaussianNoiser
|
| 54 |
from ltx_core.components.protocols import DiffusionStepProtocol
|
|
|
|
| 62 |
from ltx_pipelines.distilled import DistilledPipeline
|
| 63 |
from ltx_pipelines.utils import (
|
| 64 |
res2s_audio_video_denoising_loop,
|
| 65 |
+
euler_denoising_loop
|
| 66 |
cleanup_memory,
|
| 67 |
encode_prompts,
|
| 68 |
denoise_audio_video,
|
|
|
|
| 239 |
generator = torch.Generator(device=self.device).manual_seed(seed)
|
| 240 |
noiser = GaussianNoiser(generator=generator)
|
| 241 |
stepper = Res2sDiffusionStep()
|
| 242 |
+
stage_2_stepper = EulerDiffusionStep()
|
| 243 |
dtype = torch.bfloat16
|
| 244 |
|
| 245 |
ctx_p, ctx_n = encode_prompts(
|
|
|
|
| 313 |
)
|
| 314 |
|
| 315 |
def stage2_denoising_loop(sigmas: torch.Tensor, video_state, audio_state, stepper: DiffusionStepProtocol):
|
| 316 |
+
return euler_denoising_loop(
|
| 317 |
sigmas=sigmas,
|
| 318 |
video_state=video_state,
|
| 319 |
audio_state=audio_state,
|
| 320 |
+
stepper=stage_2_stepper,
|
| 321 |
denoise_fn=simple_denoising_func(
|
| 322 |
video_context=v_context_p,
|
| 323 |
audio_context=a_context_p,
|