How to combine different files to a Array[file] and send to LLM #30385
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.Here's a scenario: Therefore, in the workflow, I intend to set the base image as content loaded by default (without requiring user input). During the workflow processing, I need to combine the user-provided image with the base image into a single image list, which will be passed to the LLM as visual input. However, I cannot find any solution that allows the LLM to use the combined image as visual input—it seems the LLM can only reference user inputs directly. 2. Additional context or comments
you can see, only user inputs variables available here, python file results are ignored, I have no idea at all...
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Dify can technically send multiple images (Array[File]) to an LLM node if you aggregate them into a single array variable and wire that variable into the node’s vision config. However, the workflow UI only allows you to select user input variables (like If you need to combine a base image (template) and a user-uploaded image, the recommended pattern is to upload both images via the UI or API, aggregate them into an array (Array[File]), and reference that array in the LLM node’s vision config. If you want to inject files from a code node, you must upload them using the Workarounds:
Currently, there’s no built-in way to pass files generated by Python code nodes as visual input to the LLM node in the UI. You may want to monitor future updates or contribute to feature requests for more flexible file variable handling source. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.

Dify can technically send multiple images (Array[File]) to an LLM node if you aggregate them into a single array variable and wire that variable into the node’s vision config. However, the workflow UI only allows you to select user input variables (like
sys.filesoruserinput.files) for visual input, and files generated by code nodes aren’t automatically available for selection unless you explicitly add them as File objects in the variable pool with the correct type and selector. This is a known limitation—only files uploaded via the UI are reliably passed to the LLM node as visual input, not files produced or combined in intermediate code steps source.If you need to combine a base imag…