Nodes/ComfyUI-SCStepFun/StepFun Video File Uploader
ComfyUI Node

StepFun Video File Uploader

// link the cloud can actually watch

By chenbaiyujason·Created 2 years ago·Updated 2 years ago· 7
StepFun Video File Uploader
  • client
  • file_link
file_path
force_reuploadfalse

StepFun Video File Uploader solves the mismatch at the heart of video understanding in this pack: the StepFun Video Chat node only accepts URLs, but your video is sitting on your hard drive. This node bridges that gap. Give it the absolute path to a local file, it uploads the video to StepFun's storage, and it hands back a stepfile://file-id link you paste straight into video_url on the video chat node.

The flow is: StepFunClient → VideoFileUploader → VideoChat. The uploader is the only node in the pack that ships a real local file to the cloud, and it's the one the README's StepFunVideo2Caption workflow uses under the hood.

How it works

The node calls client.files.create(file=..., purpose="storage") on the StepFun API and formats the returned file id into a stepfile:// link. Two details make it friendlier than a raw upload:

  • It caches. Each file is hashed with MD5, and the hash → link mapping is stored in a video_upload_cache.json file inside the pack's directory. Re-run the workflow with the same file and it skips the upload entirely, using the cached link. Change the file, the hash changes, and it re-uploads automatically.
  • It talks to the UI. The node pushes progress messages (stepfun.file.upload events) so you can see "uploading…" / "success" in the frontend instead of staring at a frozen node.

If you want to force a fresh upload of an unchanged file - say, a cached link expired server-side - flip force_reupload.

Inputs and outputs

  • client - the STEPFUN_CLIENT from StepFunClient. Required.
  • file_path - the absolute path to the video on the machine running ComfyUI, e.g. C:\Users\You\Downloads\test.mp4 or /home/you/videos/clip.mp4.
  • force_reupload - boolean, default false. Bypasses the MD5 cache.

Output: file_link, a string like stepfile://ftk_abc123, ready for video_url in VideoChat.

Installing

Same pack install as everything else:

cd ComfyUI/custom_nodes
git clone https://github.com/chenbaiyujason/ComfyUI_StepFun
cd ComfyUI_StepFun
pip install -r requirements.txt

Or search "ComfyUI-SCStepFun" in ComfyUI Manager, restart, and it appears under the StepFun category. You need an API key (via StepFunClient) - uploads bill against your account.

Common issues

  • "文件不存在" / file not found - the path must be absolute and must point at a file the ComfyUI process can read. If you're running ComfyUI on a remote box, "your" path and "its" path are different things.
  • Videos too large - the README suggests keeping uploads under ~128MB and preprocessing with FFmpeg. Split long videos into chunks:
ffmpeg -i sample.mp4 -acodec copy -f segment -segment_time 120 -vcodec copy -reset_timestamps 1 -map 0 output_time_%d.mp4

And convert odd formats to MP4: ffmpeg -i sample.mkv -codec copy sample.mp4.

  • Stale README - the top of the README still claims "video upload is not implemented," but the shipped code and the README's own uploader section both confirm it exists. Trust the code here; that first line is leftover from an early version.

  • Cache confusion - if a link suddenly 401s but the file hasn't changed, the cached stepfile:// link likely expired. Set force_reupload to true once and it'll refresh the cache.

It's a narrow node with a narrow job, but it's the difference between "I can only analyze hosted videos" and "I can analyze my own footage." If you're building a video-caption pipeline on this pack, it's the piece that makes it work.

CategoryStepFun

Inputs (3)

NameTypeDefaultDescription
clientSTEPFUN_CLIENT
file_pathSTRING
force_reuploadBOOLEANfalse

Outputs (1)

NameTypeDescription
file_linkSTRING