承接 ediasoft/midjourney-api-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ediasoft/midjourney-api-php

Composer 安装命令:

composer require ediasoft/midjourney-api-php

包简介

Midjourney API PHP Client for PHP.

README 文档

README

Midjourney API client for PHP

Midjourney Splash

yellow-button

The Midjourney PHP API Client Package is a comprehensive library that allows developers to interact with the Midjourney API through Discord. Midjourney is an AI platform that can generate image base your prompt.

This PHP API client package aims to simplify the integration of the Midjourney API into your PHP applications, enabling you to access the powerful features of the Midjourney platform seamlessly.

Features

  • Imagine: Create a image base your given prompt. This will return four different options to choose from.
  • Upscale: Get the full size of the generated image.

Upcoming release

  • Blend: Able to blend two or more images together.
  • Describe It will generate four possible prompt base up the given image.
  • Shorten Analyze your prompt and highlights and it wil suggests unnecessary words you could remove.

Installation

You can install the Midjourney PHP API Client Package using Composer. Run the following command:

composer require ediasoft/midjourney-api-php

Usage

Basic usage

Create a MidjourneyApiClient object with valid credentials and you will be able to access all the available commands. See the Imagine command down below:

use eDiasoft\Midjourney\MidjourneyApiClient;

$channel_id = 00000000;
$authorization = "AUTH_TOKEN";

$midjourney = new MidjourneyApiClient($channel_id, $authorization);

$result = $midjourney->imagine('Elephant and a snake romantically having a diner')->send();

return $result;

Constructor

  • $channel_id - Go to your discord channels and right click on the channel where the Midjourney Bot is active on. Click on Copy Channel ID Copy Channel ID

    If you don't see this menu option you have to enable developer mode. Go to User Settings > Advanced (Under APP Settings) > Developer Mode (Enabled)

    Discord User Token

  • $authorization - Caution: Discord strictly prohibits the use of automatic user accounts, also known as self-bots. Engaging in such activities can lead to the termination of your Discord account if detected. Therefore, we strongly advise against using self-bots to avoid any potential risks and consequences. Please be mindful of Discord's terms of service and use the platform responsibly and within its allowed guidelines.

    To get your user token, go to https://discord.com/channels/@me and open the Network tab inside the Developers Tools by pressing op F12. Locate the calls that is directing to the Discord API such as friend-suggestions and open the Request Headers tab and locate the Authorization and copy this value.

    Discord User Token

Commands

Imagine

$imagine_builder = $midjourney->imagine('Elephant and a snake romantically having a diner'); //Returns a Builder object
Parameters
$imagine_builder->aspectRatio('16:9') //Changing the aspect ratio.
                ->chaos(30) //The higher the chaos the more unusual and unexpected results.
                ->fast() //Enable fast mode for this single job.
                ->imageWeight(1.75) //Sets image prompt weight relative to text weight. The default value is 1.
                ->no('moon roses') //Exclude specific object in the image.
                ->quality(0.5)
                ->relax() //This will turn on relax mode for this single job, the interval of retrieving the image will be also delayed. 
                ->repeat(40) //Create multiple Jobs from a single prompt.
                ->seed(1000) //The Midjourney bot uses a seed number to create a field of visual noise, like television static, as a starting point to generate the initial image grids.
                ->stop(35) //Stopping a Job at an earlier percentage can create blurrier, less detailed results.
                ->style('cute')
                ->stylize(5) //Influences how strongly Midjourney's default aesthetic style is applied
                ->tile() //Generates images that can be used as repeating tiles to create seamless patterns.
                ->turbo() //Override your current setting and run a single job using Turbo Mode.
                ->weird(1000); //Explore unusual aesthetics with the experimental weird parameter

$result = $imagine_builder->send()

Check the documentation for the complete explanation.

Upcale

$message_id = "1234";
$upscale_image_id = "MJ::JOB::upsample::1::xxxxx";
$interaction_id = $imagine_builder->interactionId(); //You can retrieve this ID after the imagine interaction is performed, this is a identifier for the specific job request.

$upscale_builder = $midjourney->upscale($message_id, $upscale_image_id, $interaction_id); //Returns a Builder object

$upscaled_image_result = $upscale_builder->send();

Documentation

For detailed information about the available endpoints and their parameters, please refer to the official Midjourney documentation.

Contributing

We welcome contributions from the community! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on our GitHub repository.

License

This package is open-source and released under the MIT License. Feel free to use and modify it according to your project needs.

Support

For any questions or support regarding the Midjourney PHP API Client Package, you can contact us at support@ediasoft.com.

ediasoft/midjourney-api-php 适用场景与选型建议

ediasoft/midjourney-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.69k 次下载、GitHub Stars 达 39, 最近一次更新时间为 2023 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ediasoft/midjourney-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ediasoft/midjourney-api-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 ediasoft/midjourney-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 39
  • Watchers: 1
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-04