Merge pull request #141 from Visionatrix/fix/submodule

correct submodule download
This commit is contained in:
ssitu
2025-03-06 09:58:45 -05:00
committed by GitHub
3 changed files with 21 additions and 13 deletions
+8
View File
@@ -16,6 +16,14 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Include submodule files
run: |
# Remove the submodule's .git folder so it becomes a normal directory
rm -rf repositories/ultimate_sd_upscale/.git
# Add the now "regular" folder to the index
git add repositories/ultimate_sd_upscale
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
+12 -12
View File
@@ -1,31 +1,31 @@
import sys
import os
# Check for original USDU script
current_dir = os.path.dirname(os.path.realpath(__file__))
repos_dir = os.path.join(current_dir, "repositories")
usdu_dir = os.path.join(repos_dir, "ultimate_sd_upscale")
if len(os.listdir(usdu_dir)) == 0:
if not len(os.listdir(usdu_dir)):
print("[USDU] Original USDU script not found, downloading it from https://github.com/Coyote-A/ultimate-upscale-for-automatic1111")
import urllib.request
import zipfile
import shutil
# Download the repo
url = "https://github.com/Coyote-A/ultimate-upscale-for-automatic1111/archive/refs/heads/master.zip"
zip_path = os.path.join(repos_dir, "usdu.zip")
url = "https://github.com/Coyote-A/ultimate-upscale-for-automatic1111/archive/master.zip"
zip_path = os.path.join(current_dir, "usdu_temp.zip")
urllib.request.urlretrieve(url, zip_path)
# Extract the repo
with zipfile.ZipFile(zip_path, "r") as zip_ref:
zip_ref.extractall(repos_dir)
# Move the repo to the correct location
extracted_dir = os.path.join(repos_dir, "ultimate-upscale-for-automatic1111-master")
shutil.move(extracted_dir, usdu_dir)
top_folder = zip_ref.namelist()[0].split('/')[0] + '/'
for member in zip_ref.namelist():
if member.startswith(top_folder) and not member.endswith('/'):
target_path = os.path.join(usdu_dir, member[len(top_folder):])
os.makedirs(os.path.dirname(target := os.path.join(usdu_dir, member[len(top_folder):])), exist_ok=True)
with zip_ref.open(member) as source, open(target, 'wb') as target_file:
shutil.copyfileobj(fsrc=zip_ref.open(member), fdst=target_file)
# Clean up
os.remove(zip_path)
print("[USDU] Original USDU script downloaded successfully")
# Remove other custom_node paths from sys.path to avoid conflicts
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui_ultimatesdupscale"
description = "ComfyUI nodes for the Ultimate Stable Diffusion Upscale script by Coyote-A."
version = "1.1.1"
version = "1.1.2"
license = { file = "LICENSE" }
[project.urls]