fix: 🔥 manage pip from install only, remove requirements.txt (#38)

This commit is contained in:
Mel Massadian
2023-07-30 01:20:05 +02:00
committed by GitHub
parent 9b24eddd9c
commit 247fbfbc21
7 changed files with 20 additions and 23 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
- name: 📦 Building and Bundling wheels
shell: bash
run: |
python -m pip wheel --no-cache-dir -r requirements-wheels.txt -w ./wheels 2>&1 | tee build.log
python -m pip wheel --no-cache-dir -r reqs.txt -w ./wheels 2>&1 | tee build.log
# find source wheels
packages=$(cat build.log | awk -F 'Building wheels for collected packages: ' '{print $2}')
+2 -2
View File
@@ -49,7 +49,7 @@ python scripts/download_models.py
1. 确保您处于用于 ComfyUI 的 Python 环境中。
2. 运行以下命令安装所需的依赖项:
```bash
pip install -r comfy_mtb/requirements.txt
pip install -r comfy_mtb/reqs.txt
```
</details>
@@ -77,7 +77,7 @@ python scripts/download_models.py
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
!pip install -r custom_nodes/comfy_mtb/reqs.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
如果运行后 colab 抱怨需要重新启动运行时,请重新启动,然后不要重新运行之前的单元格,只运行运行本地隧道的单元格。(可能需要先添加一个包含 `%cd ComfyUI` 的单元格)
+2 -2
View File
@@ -52,7 +52,7 @@ python scripts/download_models.py
1. ComfyUIで使用しているPython環境であることを確認してください。
2. 以下のコマンドを実行して、必要な依存関係をインストールします:
```bash
pip install -r comfy_mtb/requirements.txt
pip install -r comfy_mtb/reqs.txt
```
</details>
@@ -78,7 +78,7 @@ ComfyUI with localtunnel (Recommended Way)**ヘッダーのすぐ後(コード
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
!pip install -r custom_nodes/comfy_mtb/reqs.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
これを実行した後、colabがランタイムを再起動する必要があると文句を言ったら、それを実行し、それ以前のセルは再実行せず、localtunnelを実行するセルだけを再実行してください。(最初に`%cd ComfyUI`のセルを追加する必要があるかもしれません...)
+2 -2
View File
@@ -48,7 +48,7 @@ On first run the script [tries to symlink](https://github.com/melMass/comfy_mtb/
1. Make sure you are in the Python environment you use for ComfyUI.
2. Install the required dependencies by running the following command:
```bash
pip install -r comfy_mtb/requirements.txt
pip install -r comfy_mtb/reqs.txt
```
</details>
@@ -76,7 +76,7 @@ Add a new code cell just after the **Run ComfyUI with localtunnel (Recommended W
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
!pip install -r custom_nodes/comfy_mtb/reqs.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
If after running this, colab complains about needing to restart runtime, do it, and then do not rerun earlier cells, just the one to run the localtunnel. (you might have to add a cell with `%cd ComfyUI` first...)
+10 -13
View File
@@ -258,23 +258,16 @@ def import_or_install(requirement, dry=False):
# Install dependencies from requirements.txt
def install_dependencies(dry=False):
parsed_requirements = get_requirements(here / "requirements.txt")
parsed_requirements = get_requirements(here / "reqs.txt")
if not parsed_requirements:
return
print_formatted(
"Installing dependencies from requirements.txt...", "italic", color="yellow"
"Installing dependencies from reqs.txt...", "italic", color="yellow"
)
for requirement in parsed_requirements:
import_or_install(requirement, dry=dry)
if mode == "venv":
parsed_requirements = get_requirements(here / "requirements-wheels.txt")
if not parsed_requirements:
return
for requirement in parsed_requirements:
import_or_install(requirement, dry=dry)
if __name__ == "__main__":
full = False
@@ -328,7 +321,6 @@ if __name__ == "__main__":
# Install dependencies from requirements.txt
# if args.requirements or mode == "venv":
install_dependencies(dry=args.dry)
if (not args.wheels and mode not in ["colab", "embeded"]) and not full:
print_formatted(
@@ -336,6 +328,8 @@ if __name__ == "__main__":
"italic",
color="yellow",
)
install_dependencies(dry=args.dry)
sys.exit()
if mode in ["colab", "embeded"]:
@@ -349,7 +343,7 @@ if __name__ == "__main__":
# - Check the env before proceeding.
missing_wheels = False
parsed_requirements = get_requirements(here / "requirements-wheels.txt")
parsed_requirements = get_requirements(here / "reqs.txt")
if parsed_requirements:
for requirement in parsed_requirements:
installed, pip_name, import_name = try_import(requirement)
@@ -359,7 +353,7 @@ if __name__ == "__main__":
if not missing_wheels:
print_formatted(
f"All required wheels are already installed.", "italic", color="green"
f"All requirements are already installed.", "italic", color="green"
)
sys.exit()
@@ -408,7 +402,7 @@ if __name__ == "__main__":
)
wheels_directory.mkdir(exist_ok=True)
# - Install the wheels
for asset in matching_assets:
asset_name = asset["name"]
asset_download_url = asset["browser_download_url"]
@@ -487,3 +481,6 @@ if __name__ == "__main__":
print_formatted("Wheels installation completed.", color="green")
else:
print_formatted("No .whl files found. Nothing to install.", color="yellow")
# - Install all remainings
install_dependencies(dry=args.dry)
+3
View File
@@ -12,3 +12,6 @@ protobuf==3.20.2; platform_system == "Windows"
gdown @ git+https://github.com/melMass/gdown@main
mmdet==3.0.0
facexlib==0.3.0
insightface==0.7.3
mmcv==2.0.0
basicsr==1.4.2
-3
View File
@@ -1,3 +0,0 @@
insightface==0.7.3
mmcv==2.0.0
basicsr==1.4.2