Skip to content

Inspect

Inspects and displays any value flowing through a workflow. It formats text/JSON for readability, summarizes tensors, and attempts to render an image preview (including decoding base64-encoded images). Optionally writes a detailed summary to the system logs.
Preview

Usage

Use this node anywhere you need to debug or understand intermediate data. Connect any upstream node output to Inspect to view a human-readable summary, pretty-printed JSON (when applicable), and an image preview if the value is an image tensor or a base64-encoded image.

Inputs

FieldRequiredTypeDescriptionExample
valueTrueWILDCARDAny value to inspect (e.g., strings, numbers, dicts, lists, JSON strings, torch tensors, or objects). JSON strings are detected and pretty-printed; tensors are summarized; base64 image strings are decoded for preview when possible.{"user": "alice", "score": 42}
write_logsTrueBOOLEANIf true, writes a formatted summary of the value (with separators) to the logs.true

Outputs

FieldTypeDescriptionExample
valueSTRINGThe inspected value as a string. For JSON inputs, this will be pretty-printed. For other types, a readable string representation is provided.{ "user": "alice", "score": 42 }
image_previewIMAGEAn image tensor preview derived from the input, when possible. If the input is an image tensor or a base64 image string, a corresponding preview is produced; otherwise, a default blank image is returned.Tensor with shape [1, H, W, 3] and float32 values in [0, 1]

Important Notes

  • Output Node: This node is designed to display information directly in the UI and can act as a terminal inspection point in a workflow.
  • JSON handling: If the input is a valid JSON string, it is parsed and pretty-printed; otherwise the raw string is shown.
  • Tensor handling: Tensors are summarized in text and, when they represent images, are shown as an image preview.
  • Base64 images: Strings starting with data URL prefixes (e.g., "data:image/..."), JPEG markers ("/9j/"), or PNG markers ("iVBOR") are treated as base64 images and decoded for preview.
  • Fallback preview: If an image cannot be derived from the input, a small blank image is returned as a preview.
  • Logging control: Set write_logs to false to avoid verbose logs when inspecting large or frequent values.

Troubleshooting

  • Image preview shows a blank image: Ensure the input is either an image-like tensor (with valid dimensions and channels) or a valid base64-encoded image string (e.g., "data:image/png;base64,").
  • JSON did not pretty-print: Verify the input is valid JSON. If you pass a Python-like string (single quotes or non-JSON syntax), the node will display it as a raw string. Prefer passing a dict/list object or a valid JSON string.
  • Large outputs slow down logging: Disable write_logs to prevent heavy log I/O when inspecting large tensors or long strings.
  • Unexpected text in the node display: The UI shows a stringified version of the result. If the input is complex or includes non-serializable objects, provide a simpler representation (e.g., convert to JSON-serializable structures).

Example Pipelines

Example
Example