🎨 MCP integration for DreamTail (SDXL on Jetson Orin) - dreamtail_generate: Create images with prompts - dreamtail_get_info: Get last generated image path - Inline display support for Claude Desktop - Configurable JPEG quality and download directory Built with love for the hardware dragon 🦊
52 lines
1.5 KiB
Python
Executable File
52 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Quick test script to verify dreamtail_generate works
|
|
Run this to test the tool without Claude Desktop
|
|
"""
|
|
|
|
import asyncio
|
|
import sys
|
|
sys.path.insert(0, '/home/alex/Projects/dreamtail-mcp')
|
|
|
|
# Import the actual function by accessing it from the tool wrapper
|
|
import dreamtail_mcp
|
|
|
|
async def test():
|
|
print("Testing dreamtail_generate tool...")
|
|
print("=" * 60)
|
|
|
|
try:
|
|
# Get the actual function from the tool wrapper
|
|
tool = dreamtail_mcp.mcp._tool_manager._tools['dreamtail_generate']
|
|
actual_function = tool.fn
|
|
|
|
result = await actual_function(
|
|
prompt="a simple test image of a red circle",
|
|
width=512, # Smaller for faster testing
|
|
height=512,
|
|
num_inference_steps=20 # Fewer steps for faster testing
|
|
)
|
|
|
|
print("\n✓ Tool executed successfully!")
|
|
print(f"Result type: {type(result)}")
|
|
print(f"Result: {result}")
|
|
|
|
# If it's an Image object, check its properties
|
|
if hasattr(result, 'data'):
|
|
print(f"Image data size: {len(result.data)} bytes")
|
|
print(f"Image format: {result.format if hasattr(result, 'format') else 'unknown'}")
|
|
|
|
return True
|
|
|
|
except Exception as e:
|
|
print(f"\n❌ Tool failed with error:")
|
|
print(f"Error type: {type(e).__name__}")
|
|
print(f"Error: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
success = asyncio.run(test())
|
|
sys.exit(0 if success else 1)
|