I use Dify to upload an image and then submit the image to https://api.tripo3d.ai/v2/openapi/upload via an HTTP node to generate a 3D model from the image. This workflow was functional in version 0.10, but after upgrading to version 0.13, the tripo3d A… #7138

Closed
opened 2026-02-21 18:19:05 -05:00 by yindo · 4 comments
Owner

Originally created by @conglei1981 on GitHub (Dec 11, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.13.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use Dify to upload an image and then submit the image to https://api.tripo3d.ai/v2/openapi/upload via an HTTP node to generate a 3D model from the image. This workflow was functional in version 0.10, but after upgrading to version 0.13, the tripo3d API returns an error. Testing the tripo3d API with Postman works without issues. Additionally, when using the tool's custom tool to generate a utility for file uploads, it is not possible to select a file-type parameter on the frontend.

To address the issue of being unable to select a file-type parameter on the frontend with the custom tool generated by the tool, you might need to ensure that the custom tool is properly configured to handle multipart/form-data requests, which are typically used for file uploads. It's also important to check if there have been any changes in the tool or framework (version 0.13) that could affect how file inputs are handled or how the request is constructed and sent to the tripo3d API. Reviewing the release notes or changelog for version 0.13 might provide insights into what has changed and how to adapt your workflow accordingly.

image
image
image

✔️ Expected Behavior

post a image to tripo3d api

Actual Behavior

"{"code":1004,"message":"One or more of your parameter is invalid","suggestion":"Refer to the API documentation for parameter requirements"}",

Originally created by @conglei1981 on GitHub (Dec 11, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.13.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I use Dify to upload an image and then submit the image to https://api.tripo3d.ai/v2/openapi/upload via an HTTP node to generate a 3D model from the image. This workflow was functional in version 0.10, but after upgrading to version 0.13, the tripo3d API returns an error. Testing the tripo3d API with Postman works without issues. Additionally, when using the tool's custom tool to generate a utility for file uploads, it is not possible to select a file-type parameter on the frontend. To address the issue of being unable to select a file-type parameter on the frontend with the custom tool generated by the tool, you might need to ensure that the custom tool is properly configured to handle multipart/form-data requests, which are typically used for file uploads. It's also important to check if there have been any changes in the tool or framework (version 0.13) that could affect how file inputs are handled or how the request is constructed and sent to the tripo3d API. Reviewing the release notes or changelog for version 0.13 might provide insights into what has changed and how to adapt your workflow accordingly. ![image](https://github.com/user-attachments/assets/c376ec51-c84b-4f6a-931e-553ee97b237d) ![image](https://github.com/user-attachments/assets/4a9d9d28-3132-45a1-b6f7-2aa366965c8e) ![image](https://github.com/user-attachments/assets/ff48c74a-8b72-4479-b337-a4dc04ef8d80) ### ✔️ Expected Behavior post a image to tripo3d api ### ❌ Actual Behavior "{\"code\":1004,\"message\":\"One or more of your parameter is invalid\",\"suggestion\":\"Refer to the API documentation for parameter requirements\"}",
yindo added the 🐞 bug label 2026-02-21 18:19:05 -05:00
yindo closed this issue 2026-02-21 18:19:05 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 11, 2024):

Hey @conglei1981! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing.

I found a similar closed issue that might be relevant to your problem: Workflow as Tool, if there are pictures in the parameters, they cannot be quoted correctly. This issue was resolved by a pull request that added support for the FILE type in the ToolParameterConverter [1].

In Dify version 0.13, there were significant changes related to file uploads and HTTP requests. The image upload feature was integrated into a more comprehensive file upload feature, allowing for various file types, and the sys.files variable in Workflow applications was marked as LEGACY. Developers are encouraged to use custom file variables instead [2].

For handling multipart/form-data requests, Dify uses a separate HTTP client configured for this content type. The file_upload method prepares multipart data, which includes file contents and metadata, and sends the request using this client [3].

Additionally, there are known issues and limitations with file uploads in version 0.13, such as file size limitations, batch count limits, and restrictions on file types. Only one file can be uploaded at a time, and a filename is required [4].

To address the issue with the tripo3d API, ensure that your HTTP node is correctly configured to handle multipart/form-data requests and that the file parameters meet the API's requirements. You might also need to review the changes in version 0.13 to adapt your workflow accordingly.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Dec 11, 2024): <!-- Greeting --> Hey @conglei1981! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing. <!-- Answer --> I found a similar closed issue that might be relevant to your problem: [Workflow as Tool, if there are pictures in the parameters, they cannot be quoted correctly](https://github.com/langgenius/dify/issues/5113). This issue was resolved by a pull request that added support for the `FILE` type in the `ToolParameterConverter` <sup>[[1]](https://github.com/langgenius/dify/issues/5113)</sup>. In Dify version 0.13, there were significant changes related to file uploads and HTTP requests. The image upload feature was integrated into a more comprehensive file upload feature, allowing for various file types, and the `sys.files` variable in Workflow applications was marked as `LEGACY`. Developers are encouraged to use custom file variables instead <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/bulletin.md)</sup>. For handling `multipart/form-data` requests, Dify uses a separate HTTP client configured for this content type. The `file_upload` method prepares multipart data, which includes file contents and metadata, and sends the request using this client <sup>[[3]](https://github.com/langgenius/dify/blob/main/sdks/php-client/dify-client.php)</sup>. Additionally, there are known issues and limitations with file uploads in version 0.13, such as file size limitations, batch count limits, and restrictions on file types. Only one file can be uploaded at a time, and a filename is required <sup>[[4]](https://github.com/langgenius/dify/blob/main/api/controllers/console/files.py)</sup>. To address the issue with the tripo3d API, ensure that your HTTP node is correctly configured to handle `multipart/form-data` requests and that the file parameters meet the API's requirements. You might also need to review the changes in version 0.13 to adapt your workflow accordingly. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/76b0c8e0-2d6a-475d-b008-b11f146df14a?feedback_type=other)</sup>
Author
Owner

@conglei1981 commented on GitHub (Dec 11, 2024):

Using the following schema to generate a custom tool, the upload interface is unable to submit a parameter of file type.

openapi: 3.0.1
info:
title: Tripo 3D Generation
description: use tripo to generate 3d models
version: 1.0.0
servers:

  • url: https://api.tripo3d.ai/v2/openapi
    paths:
    /task/{task_id}:
    get:
    summary: use the task_id created by createTask to get the status of a task
    operationId: getTask
    parameters:
    - name: task_id
    in: path
    required: true
    schema:
    type: string
    responses:
    '200':
    description: succeed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 0
    data:
    $ref: '#/components/schemas/Task'
    required:
    - code
    - data
    '400':
    description: failed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 2000
    - 2001
    message:
    type: string
    suggestion:
    type: string
    required:
    - code
    - message
    - suggestion
    /upload:
    post:
    summary: upload a file
    operationId: uploadFile
    requestBody:
    content:
    multipart/form-data:
    schema:
    type: object
    properties:
    file:
    type: string
    format: binary
    description: The image file to be uploaded. Only JPEG and PNG are accepted.
    required:
    - file
    required: true
    responses:
    '200':
    description: succeed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 0
    data:
    type: object
    properties:
    image_token:
    type: string
    required:
    - image_token
    required:
    - code
    - data
    '400':
    description: failed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 2000
    - 2002
    - 2004
    message:
    type: string
    suggestion:
    type: string
    required:
    - code
    - message
    - suggestion
    /task:
    post:
    summary: create a task
    operationId: createTask
    requestBody:
    content:
    application/json:
    schema:
    oneOf:
    - type: object
    properties:
    type:
    type: string
    enum:
    - text_to_model
    prompt:
    type: string
    maxLength: 1024
    negative_prompt:
    type: string
    maxLength: 1024
    model_version:
    type: string
    enum:
    - default
    - v1.3-20240522
    - v1.4-20240625
    - v2.0-20240919
    face_limit:
    type: integer
    texture:
    type: boolean
    pbr:
    type: boolean
    required:
    - type
    - prompt
    - type: object
    properties:
    type:
    type: string
    enum:
    - image_to_model
    file:
    type: object
    properties:
    type:
    type: string
    file_token:
    type: string
    required:
    - type
    - file_token
    model_version:
    type: string
    enum:
    - default
    - v1.3-20240522
    - v1.4-20240625
    - v2.0-20240919
    face_limit:
    type: integer
    texture:
    type: boolean
    pbr:
    type: boolean
    required:
    - type
    - file
    - type: object
    properties:
    type:
    type: string
    enum:
    - multiview_to_model
    files:
    type: array
    items:
    type: object
    properties:
    type:
    type: string
    file_token:
    type: string
    required:
    - type
    - file_token
    mode:
    type: string
    enum:
    - LEFT
    - RIGHT
    model_version:
    type: string
    enum:
    - default
    - v1.4-20240625
    orthographic_projection:
    type: boolean
    required:
    - type
    - files
    - mode
    - type: object
    properties:
    type:
    type: string
    enum:
    - refine_model
    draft_model_task_id:
    type: string
    required:
    - type
    - draft_model_task_id
    - type: object
    properties:
    type:
    type: string
    enum:
    - animate_prerigcheck
    original_model_task_id:
    type: string
    required:
    - type
    - original_model_task_id
    - type: object
    properties:
    type:
    type: string
    enum:
    - animate_rig
    original_model_task_id:
    type: string
    out_format:
    type: string
    required:
    - type
    - original_model_task_id
    - type: object
    properties:
    type:
    type: string
    enum:
    - animate_retarget
    original_model_task_id:
    type: string
    out_format:
    type: string
    animation:
    type: string
    enum:
    - preset:walk
    - preset:run
    - preset:dive
    required:
    - type
    - original_model_task_id
    - animation
    - type: object
    properties:
    type:
    type: string
    enum:
    - stylize_model
    style:
    type: string
    enum:
    - lego
    - voxel
    - voronoi
    - minecraft
    original_model_task_id:
    type: string
    block_size:
    type: integer
    required:
    - type
    - style
    - original_model_task_id
    - type: object
    properties:
    type:
    type: string
    enum:
    - convert_model
    format:
    type: string
    enum:
    - GLTF
    - USDZ
    - FBX
    - OBJ
    - STL
    original_model_task_id:
    type: string
    quad:
    type: boolean
    force_symmetry:
    type: boolean
    face_limit:
    type: integer
    flatten_bottom:
    type: boolean
    flatten_bottom_threshold:
    type: number
    texture_size:
    type: integer
    texture_format:
    type: string
    enum:
    - BMP
    - DPX
    - HDR
    - JPEG
    - OPEN_EXR
    - PNG
    - TARGA
    - TIFF
    - WEBP
    pivot_to_center_bottom:
    type: boolean
    required:
    - type
    - format
    - original_model_task_id
    responses:
    '200':
    description: succeed
    content:
    application/json:
    schema:
    $ref: '#/components/schemas/SuccessTask'
    '400':
    description: failed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 2000
    - 2002
    - 2003
    - 2004
    - 2006
    - 2007
    - 2008
    - 2010
    message:
    type: string
    suggestion:
    type: string
    required:
    - code
    - message
    - suggestion
    /user/balance:
    get:
    summary: get user balance
    operationId: getBalance
    responses:
    "200":
    description: succeed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum: [0]
    data:
    $ref: "#/components/schemas/Balance"
    required:
    - code
    - data
    "500":
    description: failed
    content:
    application/json:
    schema:
    type: object
    properties:
    code:
    type: integer
    enum: [1001]
    message:
    type: string
    suggestion:
    type: string
    required:
    - code
    - message
    - suggestion
    components:
    schemas:
    Task:
    type: object
    properties:
    task_id:
    type: string
    type:
    type: string
    status:
    type: string
    enum:
    - queued
    - running
    - success
    - failed
    - cancelled
    - unknown
    - banned
    - expired
    input:
    type: object
    output:
    type: object
    properties:
    model:
    type: string
    base_model:
    type: string
    pbr_model:
    type: string
    rendered_image:
    type: string
    progress:
    type: integer
    minimum: 0
    maximum: 100
    create_time:
    type: integer
    required:
    - task_id
    - type
    - status
    - input
    - output
    - progress
    - create_time
    SuccessTask:
    type: object
    properties:
    code:
    type: integer
    enum:
    - 0
    data:
    type: object
    properties:
    task_id:
    description: used for getTask
    type: string
    required:
    - task_id
    required:
    - code
    - data
    Balance:
    type: object
    properties:
    code:
    type: integer
    enum: [0]
    data:
    type: object
    properties:
    balance:
    type: number
    frozen:
    type: number
    required: ["balance", "frozen"]
    required: ["code", "data"]
@conglei1981 commented on GitHub (Dec 11, 2024): Using the following schema to generate a custom tool, the upload interface is unable to submit a parameter of file type. openapi: 3.0.1 info: title: Tripo 3D Generation description: use tripo to generate 3d models version: 1.0.0 servers: - url: https://api.tripo3d.ai/v2/openapi paths: /task/{task_id}: get: summary: use the task_id created by createTask to get the status of a task operationId: getTask parameters: - name: task_id in: path required: true schema: type: string responses: '200': description: succeed content: application/json: schema: type: object properties: code: type: integer enum: - 0 data: $ref: '#/components/schemas/Task' required: - code - data '400': description: failed content: application/json: schema: type: object properties: code: type: integer enum: - 2000 - 2001 message: type: string suggestion: type: string required: - code - message - suggestion /upload: post: summary: upload a file operationId: uploadFile requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: The image file to be uploaded. Only JPEG and PNG are accepted. required: - file required: true responses: '200': description: succeed content: application/json: schema: type: object properties: code: type: integer enum: - 0 data: type: object properties: image_token: type: string required: - image_token required: - code - data '400': description: failed content: application/json: schema: type: object properties: code: type: integer enum: - 2000 - 2002 - 2004 message: type: string suggestion: type: string required: - code - message - suggestion /task: post: summary: create a task operationId: createTask requestBody: content: application/json: schema: oneOf: - type: object properties: type: type: string enum: - text_to_model prompt: type: string maxLength: 1024 negative_prompt: type: string maxLength: 1024 model_version: type: string enum: - default - v1.3-20240522 - v1.4-20240625 - v2.0-20240919 face_limit: type: integer texture: type: boolean pbr: type: boolean required: - type - prompt - type: object properties: type: type: string enum: - image_to_model file: type: object properties: type: type: string file_token: type: string required: - type - file_token model_version: type: string enum: - default - v1.3-20240522 - v1.4-20240625 - v2.0-20240919 face_limit: type: integer texture: type: boolean pbr: type: boolean required: - type - file - type: object properties: type: type: string enum: - multiview_to_model files: type: array items: type: object properties: type: type: string file_token: type: string required: - type - file_token mode: type: string enum: - LEFT - RIGHT model_version: type: string enum: - default - v1.4-20240625 orthographic_projection: type: boolean required: - type - files - mode - type: object properties: type: type: string enum: - refine_model draft_model_task_id: type: string required: - type - draft_model_task_id - type: object properties: type: type: string enum: - animate_prerigcheck original_model_task_id: type: string required: - type - original_model_task_id - type: object properties: type: type: string enum: - animate_rig original_model_task_id: type: string out_format: type: string required: - type - original_model_task_id - type: object properties: type: type: string enum: - animate_retarget original_model_task_id: type: string out_format: type: string animation: type: string enum: - preset:walk - preset:run - preset:dive required: - type - original_model_task_id - animation - type: object properties: type: type: string enum: - stylize_model style: type: string enum: - lego - voxel - voronoi - minecraft original_model_task_id: type: string block_size: type: integer required: - type - style - original_model_task_id - type: object properties: type: type: string enum: - convert_model format: type: string enum: - GLTF - USDZ - FBX - OBJ - STL original_model_task_id: type: string quad: type: boolean force_symmetry: type: boolean face_limit: type: integer flatten_bottom: type: boolean flatten_bottom_threshold: type: number texture_size: type: integer texture_format: type: string enum: - BMP - DPX - HDR - JPEG - OPEN_EXR - PNG - TARGA - TIFF - WEBP pivot_to_center_bottom: type: boolean required: - type - format - original_model_task_id responses: '200': description: succeed content: application/json: schema: $ref: '#/components/schemas/SuccessTask' '400': description: failed content: application/json: schema: type: object properties: code: type: integer enum: - 2000 - 2002 - 2003 - 2004 - 2006 - 2007 - 2008 - 2010 message: type: string suggestion: type: string required: - code - message - suggestion /user/balance: get: summary: get user balance operationId: getBalance responses: "200": description: succeed content: application/json: schema: type: object properties: code: type: integer enum: [0] data: $ref: "#/components/schemas/Balance" required: - code - data "500": description: failed content: application/json: schema: type: object properties: code: type: integer enum: [1001] message: type: string suggestion: type: string required: - code - message - suggestion components: schemas: Task: type: object properties: task_id: type: string type: type: string status: type: string enum: - queued - running - success - failed - cancelled - unknown - banned - expired input: type: object output: type: object properties: model: type: string base_model: type: string pbr_model: type: string rendered_image: type: string progress: type: integer minimum: 0 maximum: 100 create_time: type: integer required: - task_id - type - status - input - output - progress - create_time SuccessTask: type: object properties: code: type: integer enum: - 0 data: type: object properties: task_id: description: used for getTask type: string required: - task_id required: - code - data Balance: type: object properties: code: type: integer enum: [0] data: type: object properties: balance: type: number frozen: type: number required: ["balance", "frozen"] required: ["code", "data"]
Author
Owner

@hjlarry commented on GitHub (Dec 11, 2024):

you can follow this PR https://github.com/langgenius/dify/pull/10796 , try to use file in custom tools

@hjlarry commented on GitHub (Dec 11, 2024): you can follow this PR https://github.com/langgenius/dify/pull/10796 , try to use file in custom tools
Author
Owner

@conglei1981 commented on GitHub (Dec 11, 2024):

你可以按照这个 PR #10796 ,尝试在自定义工具中使用 file

thank you

@conglei1981 commented on GitHub (Dec 11, 2024): > 你可以按照这个 PR #10796 ,尝试在自定义工具中使用 file thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7138