diff --git a/server/operators/comfyui_sd/run.py b/server/operators/comfyui_sd/run.py index b66da80..4635d3f 100644 --- a/server/operators/comfyui_sd/run.py +++ b/server/operators/comfyui_sd/run.py @@ -108,6 +108,30 @@ if LORA and ("xl" in CKPT.lower() or "biglust" in CKPT.lower() or "v2-1" in CKPT print(f"WARNING: {LORA} is SD1.5 but {CKPT} is not — the LoRA will silently do nothing. " f"Use Hyper_Realism_1.2_fp16.safetensors (see localmodels/README.md)", flush=True) +# Checkpoints are NOT identical across nodes (the M3 keeps only the LoRA-compatible +# SD1.5 model; the M1 holds the full SDXL archive). Ask this node's ComfyUI what it +# actually has and fail fast with a useful message rather than a cryptic 400. +try: + info = json.load(urllib.request.urlopen(f"{API}/object_info/CheckpointLoaderSimple")) + have = info["CheckpointLoaderSimple"]["input"]["required"]["ckpt_name"][0] + if CKPT not in have: + print(f"ERROR: '{CKPT}' is not on this node.\n" + f" available here: {', '.join(have) or '(none)'}\n" + f" The full SDXL set lives on the m1 node; every node has " + f"Hyper_Realism_1.2_fp16.safetensors (the only LoRA-compatible checkpoint).\n" + f" Fix: use a checkpoint listed above, or rsync it from m1.", flush=True) + sys.exit(1) + if LORA: + have_l = json.load(urllib.request.urlopen(f"{API}/object_info/LoraLoader")) + have_l = have_l["LoraLoader"]["input"]["required"]["lora_name"][0] + if LORA not in have_l: + print(f"ERROR: LoRA '{LORA}' is not on this node. available: {', '.join(have_l) or '(none)'}", flush=True) + sys.exit(1) +except SystemExit: + raise +except Exception as e: + print(f"(could not pre-check model availability: {e}) — continuing", flush=True) + body = json.dumps({"prompt": build(seed)}).encode() req = urllib.request.Request(f"{API}/prompt", data=body, headers={"Content-Type": "application/json"}) try: