modelscope: does not support image as an input, and response_format changes #707

Closed
opened 2026-02-16 10:20:15 -05:00 by yindo · 3 comments
Owner

Originally created by @KylinAnn on GitHub (Oct 12, 2025).

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 Dify issues & Dify Official Plugins, 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

v1.9.1

Plugin version

0.0.7

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

In this workflow, the 1st joint is for uploading files, and the second is calling modelscope (Qwen3-VL) to understand the images.

It's working at first, and not working at around 10.11 16:30:00 Beijing time, which showed "Invalid value: image. Supported values are: 'text','image_url','video_url' and 'video'.",

Image Image Image

And this morning(13th Oct), new error occurs.
[modelscope] Error: req_id: 11b241d317 PluginInvokeError: {"args":{"description":"[models] Error: Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'message': "\u003c400\u003e InternalError.Algo.InvalidParameter: Unknown format of response_format, response_format should be a dict, includes 'type' and an optional key 'json_schema'. The response_format type from user is \u003cclass 'str'\u003e.", 'param': None, 'type': 'invalid_request_error'}, 'request_id': '715ccda2-52ca-4454-9af0-c75f93a7fade'}"},"error_type":"InvokeError","message":"[models] Error: Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'message': "\u003c400\u003e InternalError.Algo.InvalidParameter: Unknown format of response_format, response_format should be a dict, includes 'type' and an optional key 'json_schema'. The response_format type from user is \u003cclass 'str'\u003e.", 'param': None, 'type': 'invalid_request_error'}, 'request_id': '715ccda2-52ca-4454-9af0-c75f93a7fade'}"}

Image

✔️ Error log

No response

Originally created by @KylinAnn on GitHub (Oct 12, 2025). ### 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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 v1.9.1 ### Plugin version 0.0.7 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce In this workflow, the 1st joint is for uploading files, and the second is calling modelscope (Qwen3-VL) to understand the images. It's working at first, and not working at around 10.11 16:30:00 Beijing time, which showed "Invalid value: image. Supported values are: 'text','image_url','video_url' and 'video'.\", <img width="1434" height="564" alt="Image" src="https://github.com/user-attachments/assets/4c5d9684-7ffc-49ad-8d6b-fb6a77417987" /> <img width="1434" height="564" alt="Image" src="https://github.com/user-attachments/assets/a8d3b3c4-2594-469a-ba74-47e7700f8f01" /> <img width="1434" height="564" alt="Image" src="https://github.com/user-attachments/assets/af618b55-db77-4efb-9abd-d0176ed216e4" /> And this morning(13th Oct), new error occurs. [modelscope] Error: req_id: 11b241d317 PluginInvokeError: {"args":{"description":"[models] Error: Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'message': \"\u003c400\u003e InternalError.Algo.InvalidParameter: Unknown format of response_format, response_format should be a dict, includes 'type' and an optional key 'json_schema'. The response_format type from user is \u003cclass 'str'\u003e.\", 'param': None, 'type': 'invalid_request_error'}, 'request_id': '715ccda2-52ca-4454-9af0-c75f93a7fade'}"},"error_type":"InvokeError","message":"[models] Error: Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'message': \"\u003c400\u003e InternalError.Algo.InvalidParameter: Unknown format of response_format, response_format should be a dict, includes 'type' and an optional key 'json_schema'. The response_format type from user is \u003cclass 'str'\u003e.\", 'param': None, 'type': 'invalid_request_error'}, 'request_id': '715ccda2-52ca-4454-9af0-c75f93a7fade'}"} <img width="1327" height="721" alt="Image" src="https://github.com/user-attachments/assets/9bd014a5-77f7-4be1-bbdb-08e326874e1c" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:15 -05:00
yindo closed this issue 2026-02-16 10:20:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 12, 2025):

Hi @KylinAnn! I'm Dosu and I’m helping the dify-official-plugins team.

This issue is caused by recent changes in the modelscope plugin and the upstream model API. The Qwen3-VL models now require image inputs to be provided as "image_url" (either a URL or base64 data), not as "image" type. Supplying "image" will trigger a validation error.

For the response_format parameter, the API now expects a dictionary with at least a "type" key (and optionally "json_schema"), not a simple string. If you send a string, you'll get a 400 error about invalid parameter format. This change was introduced in a recent update to the plugin and model configs, as seen in PR #1775.

To fix your workflow:

  • Make sure image inputs are converted to "image_url" type before sending to the model.
  • Update your plugin or workflow logic to send response_format as a dict, e.g. {"type": "json_object"} or {"type": "text"} as required by your use case.

These requirements match the errors you're seeing and are due to recent plugin and API changes. If your workflow or plugin code still uses the old formats, you'll need to update them to match the new expectations.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 12, 2025): <!-- Greeting --> Hi @KylinAnn! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> This issue is caused by recent changes in the modelscope plugin and the upstream model API. The Qwen3-VL models now require image inputs to be provided as `"image_url"` (either a URL or base64 data), not as `"image"` type. Supplying `"image"` will trigger a validation error. For the `response_format` parameter, the API now expects a dictionary with at least a `"type"` key (and optionally `"json_schema"`), not a simple string. If you send a string, you'll get a 400 error about invalid parameter format. This change was introduced in a recent update to the plugin and model configs, as seen in [PR #1775](https://github.com/langgenius/dify-official-plugins/pull/1775). To fix your workflow: - Make sure image inputs are converted to `"image_url"` type before sending to the model. - Update your plugin or workflow logic to send `response_format` as a dict, e.g. `{"type": "json_object"}` or `{"type": "text"}` as required by your use case. These requirements match the errors you're seeing and are due to recent plugin and API changes. If your workflow or plugin code still uses the old formats, you'll need to update them to match the new expectations. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0e12dc12-e42e-4a36-9371-8104f8ddb4e6?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1843)
Author
Owner

@KylinAnn commented on GitHub (Oct 16, 2025):

Need more precise instruct.

I have converted an image into base64 format outside the workflow, and pass the base64 into LLM.

However, the input would be too long, exceeding the model's max context length.

[openai_api_compatible] Error: req_id: ac9150d2b5 PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, your request has 382084 input tokens. Please reduce the length of the input messages. None","type":"BadRequestError","param":null,"code":400}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, your request has 382084 input tokens. Please reduce the length of the input messages. None","type":"BadRequestError","param":null,"code":400}}"}

@KylinAnn commented on GitHub (Oct 16, 2025): Need more precise instruct. I have converted an image into base64 format outside the workflow, and pass the base64 into LLM. However, the input would be too long, exceeding the model's max context length. [openai_api_compatible] Error: req_id: ac9150d2b5 PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"This model's maximum context length is 65536 tokens. However, your request has 382084 input tokens. Please reduce the length of the input messages. None\",\"type\":\"BadRequestError\",\"param\":null,\"code\":400}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"This model's maximum context length is 65536 tokens. However, your request has 382084 input tokens. Please reduce the length of the input messages. None\",\"type\":\"BadRequestError\",\"param\":null,\"code\":400}}"}
Author
Owner

@dosubot[bot] commented on GitHub (Oct 16, 2025):

Passing large base64-encoded images directly to the LLM will quickly exceed the model's context length, causing errors like the one you saw. The recommended approach is to upload your image to a public location (such as S3, Google Drive, or any web-accessible storage), then pass the direct image URL to the model as an "image_url" type input. This keeps your payload small and avoids context length issues.

The correct input structure for the modelscope plugin is:

{
  "type": "image_url",
  "image_url": {
    "url": "https://your-public-image-url.com/image.png"
  }
}

If you must use base64, only do so for very small images, as the token count grows rapidly. For most workflows, uploading the image and passing its URL is the best practice. The plugin does not provide automatic upload or URL generation, so this step needs to be handled outside the workflow or by a custom node.

Reference: modelscope plugin code handling image_url inputs.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 16, 2025): <!-- Answer --> Passing large base64-encoded images directly to the LLM will quickly exceed the model's context length, causing errors like the one you saw. The recommended approach is to upload your image to a public location (such as S3, Google Drive, or any web-accessible storage), then pass the direct image URL to the model as an `"image_url"` type input. This keeps your payload small and avoids context length issues. The correct input structure for the modelscope plugin is: ```json { "type": "image_url", "image_url": { "url": "https://your-public-image-url.com/image.png" } } ``` If you must use base64, only do so for very small images, as the token count grows rapidly. For most workflows, uploading the image and passing its URL is the best practice. The plugin does not provide automatic upload or URL generation, so this step needs to be handled outside the workflow or by a custom node. Reference: [modelscope plugin code handling image_url inputs](https://github.com/langgenius/dify-official-plugins/blob/074ee463937ae23a835d27aef3b1697707a6a42b/models/modelscope/models/llm/llm.py). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3ee592cc-2338-4371-8336-4fdae293bba2?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1843)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#707