Gerald LonlasandClaude Opus 4.8 d9d5c77e0f test(contracts): add image-encoding and node status behavioral contracts
Close gaps that full line+branch coverage does not catch:

- comfy_image_to_base64_png_url: assert RGBA (4-channel) tensor round-trips
  correctly through PNG encoding (pixel values preserved).
- comfy_image_to_base64_png_url: assert non-square image dimensions (H x W)
  are preserved in the encoded PNG — catches H/W transposition mutations.
- comfy_image_to_base64_png_url: assert batch[0] (red) is encoded, not
  batch[1] (blue) — catches wrong-frame-index mutations.
- image_to_text_node._responses_kwargs: assert every image content entry uses
  the key 'image_url' (not 'url') and contains a valid data:image/png;base64,
  URL — for both single and batch paths.
- image_to_text_node._responses_kwargs: assert batch frames produce distinct
  data URLs — catches mutations that pass the same index for all frames.
- image_to_text_node.execute: assert the status message contains the actual
  model name for both the responses and chat.completions fallback paths.
- text_gen_node.execute: assert the status message contains the actual model
  name for both paths — a hardcoded name mutation goes undetected otherwise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 01:26:41 +08:00

ComfyUI LMStudio Nodes (Unofficial)

Small ComfyUI custom nodes to connect to a remote LMStudio server through OpenAI-compatible API (/v1).

LMStudio ComfyUI Nodes

Nodes

  • LMStudio - Connect

    • Connect to a remote LMStudio URL
    • Set API token
    • Pull/load model list automatically (Refresh Models)
    • Test connectivity to server
    • Supports LM Reasonning mode toggle
    • Supports Tooling / MCP toggle
  • LMStudio - Text Gen

    • System prompt + user prompt
    • Text generation through the shared connection
    • <think>...</think> blocks are stripped from response output
  • LMStudio - Image To Text

    • System prompt + user prompt + image input
    • Image description / caption style generation
    • <think>...</think> blocks are stripped from response output

Quick start

  1. Put this folder in ComfyUI/custom_nodes/
  2. Install deps:
    pip install -r requirements.txt
    
  3. Restart ComfyUI

Testing

Run the Python unit tests with coverage gate (>=90%):

pytest -q

Notes

  • This is not an official LMStudio project.
  • Not affiliated with LMStudio.
  • It is a quickly vibecoded utility project.

References

S
Description
No description provided
Readme
466 KiB
Languages
Python 94.8%
JavaScript 5.2%