#!/bin/bash
API="http://127.0.0.1:8188"

echo "=== CLIPLoader info ==="
curl -s "$API/object_info/CLIPLoader" | python3.11 -c "
import sys, json
d = json.load(sys.stdin)
info = d.get('CLIPLoader', {})
inp = info.get('input', {})
print(json.dumps(inp, indent=2))
"

echo ""
echo "=== Check what lumina2 expects ==="
curl -s "$API/object_info/CLIPLoader" | python3.11 -c "
import sys, json
d = json.load(sys.stdin)
info = d.get('CLIPLoader', {})
desc = info.get('description', 'N/A')
print('Description:', desc)
out = info.get('output', [])
print('Output:', out)
"

echo ""
echo "=== Check DualCLIPLoader ==="
curl -s "$API/object_info/DualCLIPLoader" | python3.11 -c "
import sys, json
d = json.load(sys.stdin)
info = d.get('DualCLIPLoader', {})
inp = info.get('input', {})
print(json.dumps(inp, indent=2))
"

echo ""
echo "=== Available text_encoder files ==="
ls -lh /home/fabian/ComfyUI/models/text_encoders/
echo ""
echo "=== Available clip files ==="
ls -lh /home/fabian/ComfyUI/models/clip/
