✅ API Client (api/client.py)
- Full HTTP client with retry logic
- Automatic error handling
- Session management with exponential backoff
- Support for both sync and async endpoints
✅ Task Manager (api/tasks.py)
- Async task polling system
- Progress tracking
- Timeout management
- Batch processing support (foundation)
✅ Image Utilities (utils/image_utils.py)
- PIL ↔ Tensor conversions
- Base64 encoding/decoding
- Image preparation for API
- Batch processing helpers
✅ Caching System (utils/cache.py)
- Intelligent result caching
- Prevents redundant API calls
- Automatic cleanup of old entries
- Cache statistics and management
✅ 1. FreepikMystic - Text-to-Image Generation
- Photorealistic image generation
- 1K / 2K / 4K resolution support
- LoRA integration for custom styles
- Multiple aspect ratios
- Seed control for reproducibility
- Cost estimation before execution
✅ 2. FreepikUpscalerCreative - AI Upscaling with Enhancement
- 2x, 4x, 8x, 16x upscaling
- Prompt-guided enhancement
- Creativity and detail control
- Powered by Magnific.ai technology
✅ 3. FreepikUpscalerPrecision - Faithful Upscaling
- No AI hallucinations
- Perfect for logos, UI, product photos
- Denoise and sharpen controls
- High-fidelity preservation
✅ 4. FreepikRemoveBackground - Background Removal
- Fast AI-powered removal
- Returns image + alpha mask
- Synchronous operation (instant results)
ComfyUI-Freepik/
├── __init__.py # Main node registration
├── README.md # Full documentation
├── INSTALL.md # Quick installation guide
├── requirements.txt # Python dependencies
├── config.json # Configuration file
├── test.py # Test suite
│
├── api/
│ ├── __init__.py
│ ├── client.py # API HTTP client
│ └── tasks.py # Async task manager
│
├── utils/
│ ├── __init__.py
│ ├── image_utils.py # Image conversion utilities
│ └── cache.py # Caching system
│
└── nodes/
├── generation/
│ └── mystic_node.py # Mystic text-to-image
├── editing/
│ └── upscaler_nodes.py # Creative & Precision upscalers
└── utilities/
└── remove_bg_node.py # Background removal
- Automatically caches results based on parameters
- MD5 hash for unique identification
- Configurable max age (default 30 days)
- Cache statistics and management
- Real-time cost estimation
- Display before API execution
- Transparent pricing based on operations
- Track spending per workflow
- Graceful error messages
- Error placeholder images
- Detailed logging for debugging
- Automatic retry with backoff
- Real-time status updates
- Elapsed time display
- Percentage progress (where applicable)
- Cancel-safe operations
| Operation | Cost per Use |
|---|---|
| Mystic 1K | €0.05 |
| Mystic 2K | €0.10 |
| Mystic 4K | €0.20 |
| Upscale 2x (640×480 → 1280×960) | €0.10 |
| Upscale 4x (640×480 → 2560×1920) | €0.40 |
| Upscale 8x (640×480 → 5120×3840) | €1.60 |
- Copy folder to:
ComfyUI/custom_nodes/ComfyUI-Freepik/ - Install requirements:
pip install -r requirements.txt - Restart ComfyUI
- Get API key: https://www.freepik.com/developers/dashboard
- Start creating!
FreepikMystic → SaveImage
LoadImage → FreepikUpscalerPrecision (4x) → SaveImage
LoadImage → FreepikRemoveBackground → [Processing] → SaveImage
FreepikMystic (2K, architectural render) →
FreepikUpscalerCreative (4x, enhance details) →
SaveImage
- Session pooling for performance
- Automatic retry on network failures
- Request timeout handling
- Support for multipart uploads
- Non-blocking task execution
- Configurable polling intervals
- Progress callbacks
- Timeout protection
- Native ComfyUI format support
- Batch processing ready
- Memory efficient
- Type safe conversions
Run the test suite:
cd ComfyUI-Freepik
python test.py YOUR_API_KEYTests verify:
- ✅ All imports working
- ✅ Cache system functional
- ✅ Image utilities working
- ✅ Node structure correct
- ✅ API connectivity (if key provided)
- Kling v2.5 Pro node
- Kling v2.1 Std node
- PixVerse V5 node
- Video preview system
- Batch video processing
- Image Relight node
- Style Transfer node
- Image Expand (outpainting)
- Image-to-Prompt utility
- LoRA training nodes
- Webhook support
- Batch queue manager
- Credit tracker UI
- Video not yet supported - Phase 2 priority
- No batch processing UI - Foundation exists
- No webhook handler - Optional feature
- Limited error recovery - Basic retry only
- README.md - Complete documentation
- INSTALL.md - Quick installation guide
- config.json - Configuration reference
- Inline comments - Code documentation
✅ Fully functional ComfyUI-Freepik custom node ✅ 4 working nodes with API integration ✅ Smart caching system ✅ Cost estimation ✅ Error handling ✅ Comprehensive documentation ✅ Test suite ✅ Ready for production use
- Developer: Felipe @ Pixelflakes
- API: Freepik / Magnific.ai
- Framework: ComfyUI
- Inspiration: AvizStudio tools
Status: Phase 1 MVP Complete ✅ Next: Phase 2 - Video Generation Timeline: 2-3 days for video nodes
Built with ❤️ for architectural visualization workflows