MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __init__

Method __init__

tools/preprocess/process_pipepline.py:43–54  ·  view source on GitHub ↗
(self, det_checkpoint_path, pose2d_checkpoint_path, sam_checkpoint_path, flux_kontext_path)

Source from the content-addressed store, hash-verified

41
42class ProcessPipeline:
43 def __init__(self, det_checkpoint_path, pose2d_checkpoint_path, sam_checkpoint_path, flux_kontext_path):
44 self.pose2d = Pose2d(checkpoint=pose2d_checkpoint_path, detector_checkpoint=det_checkpoint_path)
45
46 model_cfg = "sam2_hiera_l.yaml"
47 if sam_checkpoint_path is not None:
48 if not _SAM2_AVAILABLE:
49 raise RuntimeError("sam2 is required for preprocessing but is not installed. Please install sam2.")
50 self.predictor = build_sam2_video_predictor(model_cfg, sam_checkpoint_path)
51 if flux_kontext_path is not None:
52 from diffusers import FluxKontextPipeline
53
54 self.flux_kontext = FluxKontextPipeline.from_pretrained(flux_kontext_path, torch_dtype=torch.bfloat16).to("cuda")
55
56 @staticmethod
57 def _get_body_keypoints(pose_meta):

Callers

nothing calls this directly

Calls 4

Pose2dClass · 0.90
toMethod · 0.45
from_pretrainedMethod · 0.45

Tested by

no test coverage detected