-
Notifications
You must be signed in to change notification settings - Fork 542
Description
Error:
Traceback (most recent call last):
File "", line 1, in
File "/data/baixinkun/tmp/LTX-2/test.py", line 55, in
pipeline(
File "/home/baixinkun/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "/data/baixinkun/tmp/LTX-2/packages/ltx-pipelines/src/ltx_pipelines/ti2vid_two_stages.py", line 99, in call
generator = torch.Generator(device=self.device).manual_seed(seed)
RuntimeError: META device type not an accelerator.
Code:
import sys
sys.path.insert(0, "/data/baixinkun/tmp/LTX-2")
from ltx_core.loader import LTXV_LORA_COMFY_RENAMING_MAP, LoraPathStrengthAndSDOps
from ltx_pipelines.ti2vid_two_stages import TI2VidTwoStagesPipeline
from ltx_core.components.guiders import MultiModalGuiderParams
from transformers import GemmaTokenizerFast
GemmaTokenizerFast.image_token_id = 100000
GemmaTokenizerFast.boi_token = "<image_boi>"
GemmaTokenizerFast.image_token = ""
GemmaTokenizerFast.eoi_token = "<image_eoi>"
import torch
torch._C._device_is_accelerator = lambda dev: True
if hasattr(torch, 'is_accelerator'):
torch.is_accelerator = lambda *args, **kwargs: True
distilled_lora = [
LoraPathStrengthAndSDOps(
"/data/huggingface/hub/models--Lightricks--LTX-2/snapshots/3e2da544631d30cc9df4fdb57e91d74d9f16ae05/ltx-2-19b-distilled-lora-384.safetensors",
0.6,
LTXV_LORA_COMFY_RENAMING_MAP
),
]
pipeline = TI2VidTwoStagesPipeline(
checkpoint_path="/data/huggingface/hub/models--Lightricks--LTX-2/snapshots/3e2da544631d30cc9df4fdb57e91d74d9f16ae05/ltx-2-19b-distilled.safetensors",
distilled_lora=distilled_lora,
spatial_upsampler_path="/data/huggingface/hub/models--Lightricks--LTX-2/snapshots/3e2da544631d30cc9df4fdb57e91d74d9f16ae05/ltx-2-spatial-upscaler-x2-1.0.safetensors",
gemma_root="/data/huggingface/hub/models--google--gemma-2b-it/snapshots/96988410cbdaeb8d5093d1ebdc5a8fb563e02bad/",
loras=[],
)
video_guider_params = MultiModalGuiderParams(
cfg_scale=3.0,
stg_scale=1.0,
rescale_scale=0.7,
modality_scale=3.0,
skip_step=0,
stg_blocks=[29],
)
audio_guider_params = MultiModalGuiderParams(
cfg_scale=7.0,
stg_scale=1.0,
rescale_scale=0.7,
modality_scale=3.0,
skip_step=0,
stg_blocks=[29],
)
Generate video from image
pipeline(
prompt="A serene landscape with mountains in the background",
negative_prompt="",
seed=42,
height=512,
width=512,
num_frames=16,
frame_rate=8,
num_inference_steps=20,
video_guider_params=video_guider_params,
audio_guider_params=audio_guider_params,
images=[("input_image.jpg", 0, 1.0)], # Image at frame 0, strength 1.0
)