add embedded python to system state

This commit is contained in:
bymyself 2025-06-21 16:29:40 -07:00
parent 75ecb31f8c
commit 38fefde06d
3 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# generated by datamodel-codegen: # generated by datamodel-codegen:
# filename: openapi.yaml # filename: openapi.yaml
# timestamp: 2025-06-17T22:03:51+00:00 # timestamp: 2025-06-21T23:28:48+00:00
from __future__ import annotations from __future__ import annotations
@ -419,6 +419,10 @@ class ComfyUISystemState(BaseModel):
pip_packages: Optional[Dict[str, str]] = Field( pip_packages: Optional[Dict[str, str]] = Field(
None, description="Map of installed pip packages to their versions" None, description="Map of installed pip packages to their versions"
) )
embedded_python: Optional[bool] = Field(
None,
description="Whether ComfyUI is running from an embedded Python distribution",
)
class BatchExecutionRecord(BaseModel): class BatchExecutionRecord(BaseModel):

View File

@ -565,6 +565,8 @@ class TaskQueue:
custom_nodes_count=self._get_custom_nodes_count(), custom_nodes_count=self._get_custom_nodes_count(),
failed_imports=self._get_failed_imports(), failed_imports=self._get_failed_imports(),
pip_packages=self._get_pip_packages(), pip_packages=self._get_pip_packages(),
manager_config=core.get_config(),
embedded_python=os.path.split(os.path.split(sys.executable)[0])[1] == "python_embeded",
) )
def _get_comfyui_version_info(self) -> ComfyUIVersionInfo: def _get_comfyui_version_info(self) -> ComfyUIVersionInfo:
@ -693,6 +695,10 @@ class TaskQueue:
cli_args["preview_method"] = str(args.preview_method) cli_args["preview_method"] = str(args.preview_method)
if hasattr(args, "enable_manager_legacy_ui"): if hasattr(args, "enable_manager_legacy_ui"):
cli_args["enable_manager_legacy_ui"] = args.enable_manager_legacy_ui cli_args["enable_manager_legacy_ui"] = args.enable_manager_legacy_ui
if hasattr(args, "front_end_version"):
cli_args["front_end_version"] = args.front_end_version
if hasattr(args, "front_end_root"):
cli_args["front_end_root"] = args.front_end_root
return cli_args return cli_args
except Exception: except Exception:
return {} return {}
@ -1051,7 +1057,7 @@ async def task_worker():
return f"Model installation error: {model_url}" return f"Model installation error: {model_url}"
while True: while True:
timeout = 4096 timeout = 4.0
task = task_queue.get(timeout) task = task_queue.get(timeout)
if task is None: if task is None:
is_empty_queue = ( is_empty_queue = (
@ -1066,7 +1072,7 @@ async def task_worker():
"[ComfyUI-Manager] Finalizing batch history with %d completed tasks", "[ComfyUI-Manager] Finalizing batch history with %d completed tasks",
task_queue.done_count(), task_queue.done_count(),
) )
await task_queue.finalize() task_queue.finalize()
logging.debug("[ComfyUI-Manager] Batch finalization complete") logging.debug("[ComfyUI-Manager] Batch finalization complete")
logging.info("\nAfter restarting ComfyUI, please refresh the browser.") logging.info("\nAfter restarting ComfyUI, please refresh the browser.")

View File

@ -724,6 +724,9 @@ components:
additionalProperties: additionalProperties:
type: string type: string
description: Map of installed pip packages to their versions description: Map of installed pip packages to their versions
embedded_python:
type: [boolean, 'null']
description: Whether ComfyUI is running from an embedded Python distribution
required: [snapshot_time, comfyui_version, python_version, platform_info] required: [snapshot_time, comfyui_version, python_version, platform_info]
BatchExecutionRecord: BatchExecutionRecord:
type: object type: object