shadowcz007 / comfyui-liveportrait

LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control
389 stars 33 forks source link

[Errno 2] No such file or directory : LivePortrait\\src\\config\\models.yaml #6

Closed karthikg-09 closed 3 months ago

karthikg-09 commented 3 months ago

Also missing requirements insightface and tyro


Traceback (most recent call last):
  File "/workspace/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/workspace/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/workspace/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/workspace/ComfyUI/custom_nodes/comfyui-liveportrait/nodes/live_portrait.py", line 234, in run
    live_portrait_pipeline = LivePortraitPipeline(
  File "/workspace/ComfyUI/custom_nodes/comfyui-liveportrait/nodes/LivePortrait/src/live_portrait_pipeline.py", line 39, in __init__
    self.live_portrait_wrapper: LivePortraitWrapper = LivePortraitWrapper(cfg=inference_cfg)
  File "/workspace/ComfyUI/custom_nodes/comfyui-liveportrait/nodes/LivePortrait/src/live_portrait_wrapper.py", line 26, in __init__
    model_config = yaml.load(open(cfg.models_config, 'r'), Loader=yaml.SafeLoader)
FileNotFoundError: [Errno 2] No such file or directory: '/workspace/ComfyUI/custom_nodes/comfyui-liveportrait/nodes/LivePortrait\\src\\config\\models.yaml'
GraftingRayman commented 3 months ago

for tyro you need to do a pip install tyro

try reinstalling the node, the requirements file has been updated

karthikg-09 commented 3 months ago

Here's the fix for the path issue when using Linux. You need to edit the live_portrait.py file, specifically lines 153-159:



inference_cfg = InferenceConfig(
    models_config=os.path.join(current_directory, 'LivePortrait/src/config/models.yaml'),
    checkpoint_F=os.path.join(liveportrait_model, 'base_models/appearance_feature_extractor.pth'),
    checkpoint_M=os.path.join(liveportrait_model, 'base_models/motion_extractor.pth'),
    checkpoint_G=os.path.join(liveportrait_model, 'base_models/spade_generator.pth'),
    checkpoint_W=os.path.join(liveportrait_model, 'base_models/warping_module.pth'),
    checkpoint_S=os.path.join(liveportrait_model, 'retargeting_models/stitching_retargeting_module.pth')
)