mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
- Run comfyui workflows directly inside other python applications using EmbeddedComfyClient. - Optional telemetry in prompts and models using anonymity preserving Plausible self-hosted or hosted. - Better OpenAPI schema - Basic support for distributed ComfyUI backends. Limitations: no progress reporting, no easy way to start your own distributed backend, requires RabbitMQ as a message broker.
21 lines
649 B
Python
21 lines
649 B
Python
from typing import Mapping, Any
|
|
|
|
|
|
def make_mutable(obj: Any) -> dict:
|
|
"""
|
|
Makes an immutable dict, frozenset or tuple mutable. Otherwise, returns the value.
|
|
:param obj: any object
|
|
:return:
|
|
"""
|
|
if isinstance(obj, Mapping) and not isinstance(obj, dict) and not hasattr(obj, "__setitem__"):
|
|
obj = dict(obj)
|
|
for key, value in obj.items():
|
|
obj[key] = make_mutable(value)
|
|
if isinstance(obj, tuple):
|
|
obj = list(obj)
|
|
for i in range(len(obj)):
|
|
obj[i] = make_mutable(obj[i])
|
|
if isinstance(obj, frozenset):
|
|
obj = set([make_mutable(x) for x in obj])
|
|
return obj
|