Load Video from URL:
Load Video From URL retrieves a video from a web address, keeps a local cached copy when the download helper can reuse it, and turns its decoded frames into images you can use in a ComfyUI workflow. It can reduce the number of frames and resize them while loading, which is useful when you need a smaller set of images for an animation or image-processing task. It processes video frames only; it does not provide an audio track.
Load Video from URL Input Parameters:
url
The address of the video to retrieve. The node downloads it to a local cache path before opening it as a video, so the address must lead to content that the download helper can fetch and OpenCV can decode. The displayed default is https://example.com/video.mp4, which is an example address rather than a video to rely on. This string input has no minimum or maximum length specified in the node.
force_fps
Limits how frequently frames are selected when the source frame rate is higher than the requested value. Set it to 0 to leave this limit off; a positive value makes the node calculate a whole-number frame interval, so the resulting frame rate is approximate and may not equal the requested number exactly. It does not create extra frames when the source frame rate is lower. The default is 0; the minimum is 0 and the maximum is 60, in steps of 1. If you also set select_every_nth, the node uses whichever setting produces the larger frame interval.
force_size
Controls whether decoded frames are resized. The options are Disabled, Custom Height, Custom Width, Custom, 256x?, ?x256, 256x256, 512x?, ?x512, and 512x512. Disabled preserves the source dimensions. Custom Width and Custom Height calculate the other dimension from the source proportions, while Custom uses both dimensions you enter. A question mark in a preset means that dimension is calculated to preserve proportions. In this implementation, 256x256 and 512x512 also calculate the height from the source proportions: they set the width to 256 or 512, respectively, and do not guarantee square frames. The first option, Disabled, is listed first, but the source does not explicitly declare a default for this menu.
custom_width
Sets the output width in pixels when force_size is Custom Width or Custom. With Custom Width, the node calculates a proportional height; with Custom, it uses this width alongside custom_height, even if that changes the video's proportions. The default is 512 pixels; the minimum is 0 and the maximum is 8192, in steps of 8. Use a positive value when this setting is active, because a zero-width image cannot be resized successfully. Other size modes do not use this value.
custom_height
Sets the output height in pixels when force_size is Custom Height or Custom. With Custom Height, the node calculates a proportional width; with Custom, it uses this height alongside custom_width, even if that changes the video's proportions. The default is 512 pixels; the minimum is 0 and the maximum is 8192, in steps of 8. Use a positive value when this setting is active, because a zero-height image cannot be resized successfully. Other size modes do not use this value.
frame_load_cap
Sets the maximum number of selected frames returned. The node stops reading once it has loaded this many frames, which can help keep a long video from producing an unexpectedly large image batch. Set it to 0 for no cap. The cap applies after the initial skip and frame-selection settings, not to every frame in the source. The default is 0; the minimum is 0 and the maximum is 1000000, in steps of 1.
skip_first_frames
Ignores this many frames at the beginning of the source video before selecting frames for output. This is useful for leaving out an opening title or unwanted footage. The count refers to original source frames, and frame selection begins at the first frame after the skipped portion. The default is 0; the minimum is 0 and the maximum is 1000000, in steps of 1. Skipping all available frames causes the node to fail because it has no images to return.
select_every_nth
Requests a frame-selection interval: 1 considers every source frame after the initial skip, 2 selects every second frame, and so on. A larger value produces fewer images. When force_fps also calls for a larger interval, that larger interval takes precedence; the two intervals are not multiplied together. The default is 1; the minimum is 1 and the maximum is 1000000, in steps of 1.
downloader
An optional choice passed to the download helper for retrieving the video. Its options are auto, aria2, and python, and the method default is auto. The supplied node source does not show how the helper chooses or uses these methods, so a specific speed advantage or availability requirement cannot be guaranteed from this code alone. This choice affects retrieval, not the later frame-selection or resize settings.
Load Video from URL Output Parameters:
frames
An IMAGE batch containing the selected video frames in their original order. Each frame is converted from the decoder's color order to RGB and represented with pixel values scaled from 0 to 1. All frames in the batch have the same output dimensions determined by force_size. Connect this output to nodes that accept images when you want to work with the video's visual frames.
frame_count
An INT giving the number of images actually loaded into frames. It reflects the effects of skipping, frame selection, an optional frame cap, and any early end to decoding. Use it to check how many images your downstream workflow will receive; it is not necessarily the video's original frame count.
video_info
A STRING summary in the form FPS: …, Frames: …, Size: …, Duration: …s. FPS is the source frame rate divided by the chosen whole-number selection interval, Frames matches frame_count, and Size gives the output width and height in pixels. Duration is calculated as the loaded frame count divided by that reported FPS, so it describes the selected batch by this calculation, not necessarily the source video's full duration or its exact playback timestamps.
Load Video from URL Usage Tips:
- Start with
force_sizeset toDisabled,force_fpsset to0,select_every_nthset to1, andframe_load_capset to a small positive number when testing a new URL. This lets you confirm that it loads before processing a large batch. - For proportion-preserving resizing, choose
Custom Width,Custom Height, or a preset with?. ChooseCustomonly when you need the exact width and height you enter, since it can stretch the image. - To reduce the number of images from a long clip, raise
select_every_nthor set a lowerforce_fps. Checkvideo_infoafterward: selection uses whole source-frame intervals, so the reported FPS can differ from the value you requested. - Use
skip_first_framesto remove an unwanted opening andframe_load_capto limit how much of the remaining video is loaded. Because the cap counts selected frames, a larger selection interval can cover a longer stretch of source footage before reaching the cap. - Be careful with large dimensions and high frame caps. The node collects decoded images and stacks them into one batch, so requesting many large frames can require substantial memory.
Load Video from URL Common Errors and Solutions:
No frames were loaded from the video.
- Explanation: This is the node's explicit error when decoding and selection produce zero frames. The video may not have opened or decoded, or
skip_first_framesmay exclude every available frame. - Solution: Confirm that the address leads to a playable video. Then try
skip_first_framesat0,select_every_nthat1, and a small positiveframe_load_capto test whether any frames can be read.
Download or connection error
- Explanation: The download helper can fail before the node opens the video, for example when an address is unreachable or the content cannot be retrieved. Its exact error text is not shown in the supplied source.
- Solution: Check the address and access to it, then retry. You can try another listed
downloaderoption, but this source does not establish which methods are installed or available in your environment.
ZeroDivisionError: division by zero
- Explanation: A size mode that calculates one dimension from the video's proportions divides by the source width or height. This can fail if the decoder reports zero for that dimension, often because it could not read valid video properties.
- Solution: Check that the URL provides a video your installation can decode. Test with
force_sizeset toDisabled; if the video still fails to load, try a different playable source.
OpenCV resize error, such as (-215:Assertion failed) inv_scale_x > 0
- Explanation: OpenCV cannot resize a frame to a zero or otherwise invalid dimension. This can happen when an active custom dimension is
0or proportional rounding produces a dimension of0for an unusually narrow or short source. - Solution: Enter positive custom dimensions. If a proportional mode fails on a very small video, try
Customwith positive values for both width and height.
Memory allocation error or the workflow stops while loading
- Explanation: The node keeps selected frames in memory and combines them into one image batch. A long clip at large dimensions can require more memory than is available; the exact error message depends on the environment.
- Solution: Set a smaller
frame_load_cap, select fewer frames withselect_every_nthorforce_fps, and choose smaller output dimensions.
