Skip to content

Commit

Permalink
fix portable version
Browse files Browse the repository at this point in the history
  • Loading branch information
chaojie committed Jan 4, 2024
1 parent a5b7fde commit 487cee7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def INPUT_TYPES(cls):

def load_motion_camera_preset(self, motion_camera):
data="[]"
with open(f'custom_nodes/ComfyUI-MotionCtrl/examples/camera_poses/test_camera_{motion_camera}.json') as f:
comfy_path = os.path.dirname(folder_paths.__file__)
with open(f'{comfy_path}/custom_nodes/ComfyUI-MotionCtrl/examples/camera_poses/test_camera_{motion_camera}.json') as f:
data = f.read()

return (data,)
Expand All @@ -175,7 +176,8 @@ def INPUT_TYPES(cls):
CATEGORY = "motionctrl"

def load_motion_traj_preset(self, motion_traj, frame_length):
points = read_points(f'custom_nodes/ComfyUI-MotionCtrl/examples/trajectories/{motion_traj}.txt',frame_length)
comfy_path = os.path.dirname(folder_paths.__file__)
points = read_points(f'{comfy_path}/custom_nodes/ComfyUI-MotionCtrl/examples/trajectories/{motion_traj}.txt',frame_length)
return (json.dumps(points),)

class MotionctrlSample:
Expand Down

0 comments on commit 487cee7

Please sign in to comment.