Item 71: comfy_nodes_workflow.py is an exact Python port of the Revise view's "copy as nodes" graph builder (pinned to a golden file generated from the JS, now in resources/logic_comfynodes.js) plus lossless PNG tEXt / WebP EXIF writers in the format ComfyUI's frontend reads on drop. The Builder's new Run Setting "Embed ComfyUI Nodes Workflow" (session_settings.pack_nodes_metadata) stamps every saved image at every save site (generation, remote VAE, inline/deferred upscales, dashboard upscales, worker images via a master pass after collection); export_favorites falls back to the Python builder. Item 93: the upscale modal gets step/pipeline reordering, inline validation (mirrored server-side, 400 on bad configs), a preset bar (Update / Save as / Revert / Delete, read-modify-write), "Run once (unsaved)", an output summary, separate Cancel and Close, a running lock and reattach after closing. Cancel now lands within one sampler step through a per-job unet function wrapper on a cloned model (never the process-wide interrupt flag), keeps completed outputs, and sends the final progress event. Also fixed: the dashboard received the session's OLDEST items as "new" after an upscale (slice at the wrong end), the poll targeted the wrong button, jobs were never pruned, two jobs could rewrite one session's manifest (409 guard). Known quirk recorded, not changed: a final pipeline step with several ratio/denoise values saves only the last combination; the summary and a warning now say so. Tests: 101 python, 59 node, 9 Playwright. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
27 lines
992 B
Python
27 lines
992 B
Python
"""Load the REAL upscale_runner.py under the test stubs (the root conftest registers a stub module of the same
|
|
name, and the sibling stubs lack upscale_image / seedvr2_upscale)."""
|
|
import importlib.util
|
|
import os
|
|
import sys
|
|
|
|
_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
_PKG = os.path.basename(_ROOT)
|
|
_CACHE = {}
|
|
|
|
|
|
def load_runner():
|
|
if "mod" in _CACHE:
|
|
return _CACHE["mod"]
|
|
ig = sys.modules.get(f"{_PKG}.image_generation")
|
|
if ig is not None:
|
|
for name in ("upscale_image", "seedvr2_upscale", "decode_latent_with_vae", "create_image_metadata"):
|
|
if not hasattr(ig, name):
|
|
setattr(ig, name, lambda *a, **k: None)
|
|
spec = importlib.util.spec_from_file_location(f"{_PKG}.upscale_runner_real", os.path.join(_ROOT, "upscale_runner.py"))
|
|
mod = importlib.util.module_from_spec(spec)
|
|
mod.__package__ = _PKG
|
|
sys.modules[spec.name] = mod
|
|
spec.loader.exec_module(mod)
|
|
_CACHE["mod"] = mod
|
|
return mod
|