/Midjourney-Diffusion-ChatGPT

Midjourney Diffusion ChatGPT Plugin

Primary LanguagePythonMIT LicenseMIT

Midjourney Diffusion ChatGPT Plugin

Midjourney Diffusion Plugin Logo

Midjourney Diffusion Plugin is a web service that generates images based on given prompts using the Midjourney Diffusion model. It is designed to be easily integrated into other applications as a plugin.

Features

  • Generate images based on given text prompts
  • Easy integration with other applications using the provided API
  • No user authentication required

API Endpoints

  • POST /generate-image - Generate an image based on the given prompt

Getting Started

  1. Clone this repository:
git clone https://github.com/your-username/midjourney-diffusion-plugin.git
Change into the project directory:
bash

cd midjourney-diffusion-plugin
Install the required dependencies:
bash

pip install -r requirements.txt
Set the necessary environment variables:
bash

export REPLICATE_API_TOKEN="your_replicate_api_token"
Run the application:
bash

python main.py
Access the API at http://localhost:7080

Usage
To generate an image based on a given prompt, send a POST request to the /generate-image endpoint with the following JSON payload:

json

{
  "prompt": "your-prompt-here"
}
The response will be a JSON object containing the generated image URL:

json
Copy code
{
  "image_url": "https://replicate.delivery/pbxt/X92N8ZZVhP6IFdy4xKGbcWpeIeDaWOUIMaWKecJoi0Ts6mjhA/out-0.png"
}
License
This project is licensed under the MIT License.