bbc-s 63f8a66cac Resolve range-step LoRA weights
Compute PerSampleLoraLoader range_step_by_batch values from image batch index and latent batch size, and let the metadata viewer regenerate summaries for older embedded metadata versions.
2026-06-01 20:49:28 +02:00
2026-06-01 20:49:28 +02:00
2026-06-01 20:49:28 +02:00

Metadata Saver Viewer for ComfyUI

Custom nodes:

  • Save Image + Metadata JSON saves each image as PNG and writes a matching .json file next to it.
  • Load Image Metadata Viewer uploads/loads an image and outputs the image, mask, metadata JSON text, and workflow JSON text.

The saved JSON uses a compact v2 layout and keeps:

  • a Fooocus-like quick summary for prompts, sampler, model, LoRA, seed, steps, CFG, scheduler, and denoise when these can be inferred from the graph;
  • the full raw ComfyUI prompt;
  • the full raw ComfyUI workflow;
  • any remaining raw extra_pnginfo fields.

workflow is stored once under raw.workflow, not duplicated inside raw.extra_pnginfo.

Large runtime strings over 50,000 characters are compacted into a small placeholder with length, sha256, and preview. This prevents recursive growth when a text preview node displays the metadata JSON and ComfyUI includes that preview text in the next queued prompt.

For PerSampleLoraLoader, the quick summary stores only the LoRA file name and the weight used for the saved image's batch index. Full LoRA settings remain in raw.prompt. Per-sample LoRA entries also include sample_number (1-based display order), weight_index (0-based internal index), and weight_count to make range/manual value selection explicit. range_step_by_batch mode is resolved using the saved image batch index and the latent batch_size, matching the runtime linspace behavior of the Per Sample LoRA Loader.

Quick summary entries for LoRA/model/VAE include used: true/false in summary. Human-readable top-level fields append (unused) when a detected node is present in the prompt but not connected to the saved image path.

filename_prefix can include subfolders and date/time formatting, for example:

%date:yyyy-MM-dd%/metedata_Test_

This saves files under ComfyUI/output/2026-05-14/ with names like metedata_Test_00001_.png and metedata_Test_00001_.json.

For reliable workflow restore, keep embed_png_metadata enabled. ComfyUI can normally load an embedded workflow by dragging the generated PNG back onto the canvas.

S
Description
No description provided
Readme
75 KiB
Languages
Python 100%