Add Load Image From URL workflow block
Summary
Implements a new workflow block that loads images from URLs with caching capabilities. This block enables workflows to dynamically fetch images from web URLs and use them as input for other workflow steps.
Features
- URL Input Support: Accepts both direct URL strings and parameter references (
$inputs.image_url) - Caching: Optional LRU cache to avoid re-downloading the same images (enabled by default)
- Security: Uses existing
load_image_from_urlfunction for URL validation and secure image loading - Error Handling: Comprehensive error handling with descriptive messages for invalid URLs or unsupported formats
- Union Types: Supports both direct values and parameter references for all inputs
Implementation Details
- Block Type:
roboflow_core/load_image_from_url@v1 - Inputs:
url: Image URL (string or parameter reference)cache: Enable/disable caching (boolean or parameter reference, defaults totrue)
- Output:
image- WorkflowImageData object ready for use in other workflow steps - Icon: Uses
fas fa-imagefor visual identification
Testing
- 17 comprehensive tests covering all functionality
- Tests use mocking to avoid network dependencies during CI/CD
- Validates manifest creation, runtime behavior, caching, and error handling
- Includes specific test for real-world URL scenarios
Files Added/Modified
inference/core/workflows/core_steps/transformations/load_image_from_url/v1.py- Main implementationinference/core/workflows/core_steps/transformations/load_image_from_url/__init__.py- Module initializationtests/workflows/unit_tests/core_steps/transformations/test_load_image_from_url.py- Test suiteinference/core/workflows/core_steps/loader.py- Block registration
🤖 Generated with Claude Code
⚡️ Codeflash found optimizations for this PR
📄 714% (7.14x) speedup for load_blocks in inference/core/workflows/core_steps/loader.py
⏱️ Runtime : 158 microseconds → 19.4 microseconds (best of 266 runs)
I created a new dependent PR with the suggested changes. Please review:
-
#1514
If you approve, it will be merged into this PR (branch feature-load-image-from-url-workflow-block).
@Grantimus9 still workgin on this? I think the required changes in execution engine laded. Any other blockers or maybe we just need to merge in latest master and test?
Just merge and test. Don't wait on me, but I'm also happy to do it later, probably tomorrow.