diff --git a/__init__.py b/__init__.py index 581a8c0..f36c744 100644 --- a/__init__.py +++ b/__init__.py @@ -3,7 +3,6 @@ import platform import random import sys from urllib.parse import unquote -import subprocess import asyncio import aiohttp from .utils import restart @@ -74,7 +73,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "RiceRoundAdvancedChoiceNode": "Advanced Choice", "RiceRoundImageBridgeNode": "Image Bridge", "RiceRoundSimpleImageNode": "Simple Image", - "RiceRoundImageNode": "Image", + "RiceRoundImageNode": "Image & Mask", "RiceRoundDownloadImageAndMaskNode": "Download Image&Mask", "RiceRoundDownloadImageNode": "Download Image", "RiceRoundRandomSeedNode": "Random Seed", @@ -155,10 +154,13 @@ async def open_selector_list_folder(request): try: if system == "Windows": os.startfile(choice_server_folder) - elif system == "Darwin": - subprocess.run(["open", choice_server_folder]) else: - subprocess.run(["xdg-open", choice_server_folder]) + import subprocess + + if system == "Darwin": + subprocess.run(["open", choice_server_folder]) + else: + subprocess.run(["xdg-open", choice_server_folder]) return web.json_response({"status": "success"}, status=200) except Exception as e: return web.json_response({"error": str(e)}, status=500) @@ -262,9 +264,9 @@ if is_on_riceround == True: PromptServer.instance.app.middlewares.append(check_login_status) if not is_on_riceround: try: - from .rice_install_client import RiceInstallClient - if RicePromptInfo().get_run_client(): + from .rice_install_client import RiceInstallClient + RiceInstallClient().run_client() except Exception as e: print(f"Error running client: {e}") diff --git a/encrypt_node.py b/encrypt_node.py index c0704d2..a61b2bf 100644 --- a/encrypt_node.py +++ b/encrypt_node.py @@ -2,6 +2,7 @@ from collections import defaultdict import copy from io import BytesIO import json +import logging import os import random import shutil @@ -11,7 +12,6 @@ import comfy.utils import time from PIL import Image from .rice_def import RiceRoundErrorDef -from .rice_install_client import RiceInstallClient from .auth_unit import AuthUnit from .publish import Publish from .utils import combine_files @@ -93,7 +93,6 @@ class RiceRoundEncryptNode: filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0] ) results = list() - pbar = comfy.utils.ProgressBar(images.shape[0]) preview_path = None for batch_number, image in enumerate(images): i = 255.0 * image.cpu().numpy() @@ -101,7 +100,6 @@ class RiceRoundEncryptNode: if batch_number == 0: preview_path = os.path.join(publish_folder, "preview.png") img.save(preview_path) - pbar.update_absolute(batch_number, images.shape[0], ("PNG", img, None)) filename_with_batch_num = filename.replace("%batch_num%", str(batch_number)) file = f"{filename_with_batch_num}_{counter:05}_.png" img.save( @@ -138,12 +136,15 @@ class RiceRoundEncryptNode: os.path.join(publish_folder, f"{template_id}.bin"), ) if RicePromptInfo().get_run_client(): + from .rice_install_client import RiceInstallClient + error_code, error_msg = RiceInstallClient().run_client() if error_code != RiceRoundErrorDef.SUCCESS: PromptServer.instance.send_sync( "riceround_toast", {"content": "加密节点发布完成,但无法启动client,建议官网重新安装", "type": "error"}, ) + logging.info(f"Debug - results length: {len(results)}, images: {results}") return {"ui": {"images": results}} diff --git a/pyproject_cloud.toml b/pyproject_cloud.toml new file mode 100644 index 0000000..d3e0118 --- /dev/null +++ b/pyproject_cloud.toml @@ -0,0 +1,14 @@ +[project] +name = "riceround_cloud" +description = "A tool for generating encrypted workflows and commercializing AI nodes for ComfyUI." +version = "1.1.1" +license = {file = "LICENSE"} +dependencies = ["aiohttp", "pyzipper", "websockets", "portalocker", "tomlkit"] + +[project.urls] +Repository = "https://github.com/RiceRound/ComfyUI_RiceRound_Cloud" + +[tool.comfy] +PublisherId = "riceround" +DisplayName = "ComfyUI_RiceRoundCloud" +Icon = "https://www.riceround.online/RiceRound.ico" diff --git a/rice_prompt_info.py b/rice_prompt_info.py index 7021be1..55d82e0 100644 --- a/rice_prompt_info.py +++ b/rice_prompt_info.py @@ -32,7 +32,7 @@ class RicePromptInfo: "Settings", "auto_overwrite", False ) self.auto_publish = self._read_config_bool("Settings", "auto_publish", True) - self.run_client = self._read_config_bool("Settings", "run_client", True) + self.run_client = self._read_config_bool("Settings", "run_client", False) self.wait_time = self._read_config_int("Settings", "wait_time", 600) self.choice_classname_map = {} self.load_choice_node_map() diff --git a/share_client_darwin b/share_client_darwin new file mode 100644 index 0000000..4976999 Binary files /dev/null and b/share_client_darwin differ diff --git a/share_client_linux b/share_client_linux new file mode 100644 index 0000000..ba619c6 Binary files /dev/null and b/share_client_linux differ diff --git a/share_client_windows.exe b/share_client_windows.exe new file mode 100644 index 0000000..6b65fb4 Binary files /dev/null and b/share_client_windows.exe differ