How to integrate Midjourney or chatgpt-4oimage models #12436

Closed
opened 2026-02-21 19:07:23 -05:00 by yindo · 2 comments
Owner

Originally created by @zyjfly on GitHub (Apr 1, 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 integrate Midjourney or chatgpt-4oimage models

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 @zyjfly on GitHub (Apr 1, 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 integrate Midjourney or chatgpt-4oimage models ### 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:07:23 -05:00
Author
Owner

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

To integrate third-party AI models like Midjourney or ChatGPT-4oimage into Dify, you can follow the general process outlined in the Dify documentation for adding custom model providers. This involves creating a YAML configuration file and implementing model invocation in a Python file. You will need to create a class that inherits from the base class and implements specific methods such as _invoke, get_num_tokens, validate_credentials, and _invoke_error_mapping [1][2].

For detailed steps, you can refer to the guide titled "How to add custom model providers in Dify" available in the Dify documentation [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 1, 2025): <!-- Answer --> To integrate third-party AI models like Midjourney or ChatGPT-4oimage into Dify, you can follow the general process outlined in the Dify documentation for adding custom model providers. This involves creating a YAML configuration file and implementing model invocation in a Python file. You will need to create a class that inherits from the base class and implements specific methods such as `_invoke`, `get_num_tokens`, `validate_credentials`, and `_invoke_error_mapping` <sup>[[1]](https://github.com/langgenius/dify-docs/issues/517)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces.md)</sup>. For detailed steps, you can refer to the guide titled "How to add custom model providers in Dify" available in the Dify documentation <sup>[[1]](https://github.com/langgenius/dify-docs/issues/517)</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/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a0ac2c5c-2666-4b8e-8586-c83656074ada?feedback_type=other)</sup>
Author
Owner

@zyjfly commented on GitHub (Apr 2, 2025):

ImageThere are currently no supported types, right?

@zyjfly commented on GitHub (Apr 2, 2025): ![Image](https://github.com/user-attachments/assets/2e2f9dd0-3920-4bda-83b2-29110e0f0aa8)There are currently no supported types, right?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12436