how to read the image in the user-defined tool when user upload a image before chatflow start #13349

Closed
opened 2026-02-21 19:11:46 -05:00 by yindo · 3 comments
Owner

Originally created by @ChengSongyang on GitHub (Apr 25, 2025).

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

how to read the image in the user-defined tool when user upload a image before chatflow start

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @ChengSongyang on GitHub (Apr 25, 2025). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. how to read the image in the user-defined tool when user upload a image before chatflow start ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo closed this issue 2026-02-21 19:11:46 -05:00
Author
Owner

@ChengSongyang commented on GitHub (Apr 25, 2025):

@dosu

@ChengSongyang commented on GitHub (Apr 25, 2025): @dosu
Author
Owner

@dosubot[bot] commented on GitHub (Apr 25, 2025):

To read an image in a user-defined tool when a user uploads an image before the chatflow starts, you can use the LLM node to directly access the file variable. Here are the steps:

  1. Enable the Features function and only check "Images" in the file types.
  2. Add an LLM node, enable the VISION feature, and select the sys.files variable, which contains the uploaded image.
  3. Add an "Answer" node at the end, filling in the output variable of the LLM node.

Ensure that the file variable contains only image files to avoid errors. If different file types might be uploaded, use a List Operation node to filter the files appropriately. This setup allows the model to analyze image data without needing additional nodes for processing images [1].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Apr 25, 2025): <!-- Answer --> To read an image in a user-defined tool when a user uploads an image before the chatflow starts, you can use the LLM node to directly access the file variable. Here are the steps: 1. Enable the Features function and only check "Images" in the file types. 2. Add an LLM node, enable the VISION feature, and select the `sys.files` variable, which contains the uploaded image. 3. Add an "Answer" node at the end, filling in the output variable of the LLM node. Ensure that the file variable contains only image files to avoid errors. If different file types might be uploaded, use a List Operation node to filter the files appropriately. This setup allows the model to analyze image data without needing additional nodes for processing images <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/file-upload.md)</sup>. <!-- 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/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=other)</sup>
Author
Owner

@ChengSongyang commented on GitHub (Apr 25, 2025):

To read an image in a user-defined tool when a user uploads an image before the chatflow starts, you can use the LLM node to directly access the file variable. Here are the steps:

  1. Enable the Features function and only check "Images" in the file types.
  2. Add an LLM node, enable the VISION feature, and select the sys.files variable, which contains the uploaded image.
  3. Add an "Answer" node at the end, filling in the output variable of the LLM node.

Ensure that the file variable contains only image files to avoid errors. If different file types might be uploaded, use a List Operation node to filter the files appropriately. This setup allows the model to analyze image data without needing additional nodes for processing images [1].

To continue talking to Dosu, mention @dosu.

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

how to read the image in user-defined tool using "from core.tools.builtin_tool.tool import BuiltinTool" and "_invoke" method @dosu

@ChengSongyang commented on GitHub (Apr 25, 2025): > To read an image in a user-defined tool when a user uploads an image before the chatflow starts, you can use the LLM node to directly access the file variable. Here are the steps: > > 1. Enable the Features function and only check "Images" in the file types. > 2. Add an LLM node, enable the VISION feature, and select the `sys.files` variable, which contains the uploaded image. > 3. Add an "Answer" node at the end, filling in the output variable of the LLM node. > > Ensure that the file variable contains only image files to avoid errors. If different file types might be uploaded, use a List Operation node to filter the files appropriately. This setup allows the model to analyze image data without needing additional nodes for processing images [[1]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/file-upload.md). > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0da97604-f1f2-4c32-9e00-e45f7ae7f9d6?feedback_type=other) how to read the image in user-defined tool using "from core.tools.builtin_tool.tool import BuiltinTool" and "_invoke" method @dosu
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13349