diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 65055a1..0000000 Binary files a/environment.yml and /dev/null differ diff --git a/hellomeme/tools/utils.py b/hellomeme/tools/utils.py index 7cffe53..ecd88ee 100644 --- a/hellomeme/tools/utils.py +++ b/hellomeme/tools/utils.py @@ -6,7 +6,7 @@ # @Date : 8/18/2024 # @Desc : -import onnx, onnxruntime +import onnxruntime import time import cv2 import numpy as np @@ -15,8 +15,6 @@ import os.path as osp def create_onnx_session(onnx_path, gpu_id=None)->onnxruntime.InferenceSession: start = time.perf_counter() - onnx_model = onnx.load(onnx_path) - onnx.checker.check_model(onnx_model) providers = [ ('CUDAExecutionProvider', { 'device_id': int(gpu_id), diff --git a/meme.py b/meme.py index 00ff698..743bf06 100644 --- a/meme.py +++ b/meme.py @@ -1,39 +1,14 @@ import json -import os import os.path as osp -import sys -import importlib.metadata - -cur_dir = osp.dirname(osp.abspath(__file__)) - -installed_packages = [package.name for package in importlib.metadata.distributions()] - -REQUIRED = { - 'diffusers':'0.33.1', 'transformers':'4.46.3', 'einops':'0.8.0', 'opencv-python':'4.10.0.84', 'tqdm':'4.67.0', - 'pillow':'10.2.0', 'onnxruntime-gpu':'1.18.1', 'onnx':'1.17.0', 'safetensors':'0.4.5', - 'accelerate':'1.1.1', 'peft':'0.13.2', 'modelscope':'', 'huggingface-hub':'' -} - -missing = [name for name in REQUIRED.keys() if name not in installed_packages] -missing_params = ' '.join([f'{k}' for k in missing]) -print("missing pkgs", missing_params) - -if missing: - python = sys.executable - os.system(f'{sys.executable} -m pip install {missing_params}') - # subprocess.check_call([python, '-m', 'pip', 'install', missing_params], stdout=subprocess.DEVNULL) import numpy as np import cv2 - from PIL import Image - import torch from einops import rearrange import folder_paths - from .hellomeme.utils import (get_drive_expression, get_drive_expression_pd_fgc, gen_control_heatmaps, @@ -49,6 +24,7 @@ from .hellomeme import (HMImagePipeline, HMVideoPipeline, download_file_from_cloud, creat_model_from_cloud) +cur_dir = osp.dirname(osp.abspath(__file__)) config_path = osp.join(cur_dir, 'hellomeme', 'model_config.json') with open(config_path, 'r') as f: MODEL_CONFIG = json.load(f) diff --git a/pyproject.toml b/pyproject.toml index 6480227..5e5b2ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_hellomeme" description = "This repository is the official implementation of the [a/HelloMeme](https://arxiv.org/pdf/2410.22901) ComfyUI interface" -version = "1.3.23" +version = "1.3.24" license = {file = "LICENSE"} [project.urls] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ad1ef22 Binary files /dev/null and b/requirements.txt differ