runninghub-api
    runninghub-api
    • Instructions for Use
    • About nodeInfoList
    • About Enterprise ComfyUI API
    • Native ComfyUI API Integration Guide
    • Start ComfyUI Task 1 - Basic
      POST
    • Start ComfyUI Task 2 - Advanced
      POST
    • Start AI App Task
      POST
    • Get Workflow JSON
      POST
    • Check Task Status
      POST
    • Check Task Output
      POST
    • Cancel ComfyUI Task
      POST
    • Get Account Information
      POST
    • Upload Resource(image\video\audio)
      POST
    • Upload Lora
      POST
    • Get Webhook Event Details
      POST
    • Resend Specific Webhook Event
      POST

      Upload Resource(image\video\audio)

      POST
      /task/openapi/upload
      当然可以,以下是优化后的标准 Markdown 格式文本:

      📌 Image-to-Image Use Case#

      The main use case is image-to-image generation, where this API is used to upload an image to the RunningHub server, allowing the loadImage node to load it during workflow execution.
      ⚠️ Note: This is not a regular image hosting service — the uploaded image cannot be accessed directly via a public URL.

      📥 Response Example#

      When the image is successfully uploaded, the API returns a response like:
      {
        "code": 0,
        "msg": "success",
        "data": {
          "fileName": "api/9d77b8530f8b3591edc5c4e8f3f55b2cf0960bb2ca35c04e32c1677687866576.png",
          "fileType": "image"
        }
      }

      🧩 How to Use fileName in the Workflow#

      The returned fileName can be inserted into a specific loadImage node within your workflow configuration.
      Example nodeInfoList:
      "nodeInfoList": [
        {
          "nodeId": "10",
          "fieldName": "image",
          "fieldValue": "api/9d77b8530f8b3591edc5c4e8f3f55b2cf0960bb2ca35c04e32c1677687866576.png"
        }
      ]

      Request

      Authorization
      Header Params
      Host
      string 
      required
      Example:
      www.runninghub.ai
      Body Params multipart/form-data
      apiKey
      string 
      required
      Example:
      {{apiKey}}
      file
      file 
      optional
      Example:
      file://D:\temp\ComfyUI_00743_uiqpt_1742470204.png
      fileType
      string 
      optional
      Example:
      image

      Request samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://www.runninghub.ai/task/openapi/upload' \
      --header 'Host: www.runninghub.ai' \
      --form 'apiKey="Please enter your own apiKey and keep it safe."' \
      --form 'file=@"D:\\temp\\ComfyUI_00743_uiqpt_1742470204.png"' \
      --form 'fileType="image"'

      Responses

      🟢200成功
      application/json
      Body
      code
      integer 
      optional
      返回标记:成功标记=0,非0失败,或者是功能码
      msg
      string 
      optional
      返回信息
      data
      object (TaskUploadResponse) 
      optional
      数据
      fileName
      string 
      optional
      fileType
      string 
      optional
      Examples
      {
          "code": 0,
          "msg": "success",
          "data": {
              "fileName": "api/9d77b8530f8b3591edc5c4e8f3f55b2cf0960bb2ca35c04e32c1677687866576.png",
              "fileType": "image"
          }
      }
      Modified at 2025-04-07 08:02:53
      Previous
      Get Account Information
      Next
      Upload Lora
      Built with