docs(tools): local ComfyUI, how to start it, and the checkpoint pair it actually has

Tools/README.md now covers the generative tools next to each other:

- comfyui_generate.py drives the LOCAL ComfyUI at 127.0.0.1:8188, which this repository does not start. A new
  subsection says so and says what to do: start Stability Matrix, launch ComfyUI, re-run. It points at
  /home/zwitschi/StabilityMatrix/Data/README.md for the package version, the launch arguments and the shared
  80 GB model library, and notes that THIRD_PARTY_NOTICES.md must carry the model and licence before a
  generated texture ships.
- generate_facade_textures.py and generate_character_textures.py are listed as the deterministic procedural
  path: no model, no network, byte-identical on every run.
- The tool's own docstring carries the same Stability Matrix instruction.

The default second checkpoint was sd_xl_base_1.0.safetensors, which is NOT installed; it is now
epicrealismXL_pureFix.safetensors, verified against the running server. The pair was smoke-tested end to end
at 512 px: both checkpoints rendered, both scored, juggernautXL won at 20.37 against 12.93, and the winner
landed on --out with the loser kept beside it.
This commit is contained in:
zwitschi committed 2026-11-10 09:26:30 +01:00
1 parent 3872ffb742
commit 65e8f01586
2 files changed
+20 -3

No files matched your search

+9 -3
View File
@@ -21,6 +21,10 @@ Outputs land in the given path and a JSON sidecar records the exact prompt, mode
seed and workflow, so an asset can be regenerated or rejected later without
guessing how it was made.
The server is a **Stability Matrix** install and nothing here starts it: if the tool cannot reach
`127.0.0.1:8188`, start Stability Matrix, launch ComfyUI, and re-run. The install, its launch arguments and
its model library are documented in `/home/zwitschi/StabilityMatrix/Data/README.md`.
Licence: the output is a generated image from a locally hosted model. `THIRD_PARTY
NOTICES.md` must record the model and its licence before the texture ships; the
sidecar carries what is needed to do that.
@@ -42,7 +46,7 @@ HOST = os.environ.get("COMFYUI_HOST", "http://127.0.0.1:8188")
DEFAULT_MODEL = "juggernautXL_ragnarok.safetensors"
# A second checkpoint by default: one model's texture is a lottery ticket, two is a comparison. Both are
# generated from the identical prompt and seed, then scored, and only the winner takes the output path.
DEFAULT_ALT_MODEL = "sd_xl_base_1.0.safetensors"
DEFAULT_ALT_MODEL = "epicrealismXL_pureFix.safetensors"
def score_image(path):
@@ -183,13 +187,15 @@ def generate_pair(args) -> int:
candidate is kept for inspection instead of thrown away. The winner is chosen by `score_image()`; when
Pillow is missing or the scores tie, the primary model keeps the output and the run says so.
"""
import dataclasses
import copy
stem, ext = os.path.splitext(args.out)
candidates = []
for label, model in (("primary", args.model), ("alternate", args.alt_model)):
out = f"{stem}__{model.replace('/', '_')[:40]}{ext}"
sub_args = dataclasses.replace(args, model=model, out=out)
sub_args = copy.copy(args)
sub_args.model = model
sub_args.out = out
if generate(sub_args) != 0:
print(f"{label} model {model} failed; continuing with what worked")
continue