Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunAPI

Midjourney API SDKs for JavaScript, Python, Ruby, Go, Java, and PHP on RunAPI.

npm PyPI RubyGems Go Reference Maven Central License


The Midjourney SDK provides typed clients for text-to-image generation, prompt-guided image editing, image-to-video generation, first-video extension, image-to-prompt analysis, prompt shortening, and seed lookup. The public midjourney-sdk repository groups the non-PHP language packages, examples, CI, and language release tags. The PHP package is released from a split Composer repository.

Install

npm install @runapi.ai/midjourney
pip install runapi-midjourney
gem install runapi-midjourney
go get github.com/runapi-ai/midjourney-sdk/go@latest

Java applications use ai.runapi:runapi-midjourney. PHP applications use the split runapi-ai/midjourney Composer package.

JavaScript quick start

import { MidjourneyClient } from '@runapi.ai/midjourney';

const client = new MidjourneyClient();
const result = await client.textToImage.run({
  model: 'midjourney-v8.1',
  prompt: 'A cobalt blue ceramic vase on white marble',
});

console.log(result.images[0].url);

Resources

  • textToImage: create, get, or create-and-poll a midjourney-v8.1 image task.
  • editImage: create, get, or create-and-poll a prompt-guided image edit.
  • imageToVideo: create, get, or create-and-poll a video task from a source image.
  • extendVideo: extend the first video from an account-owned completed imageToVideo task. Extension tasks cannot be chained.
  • imageToPrompt: synchronously derive prompt suggestions from a source image.
  • shortenPrompt: synchronously turn a prompt into 1 to 5 concise suggestions.
  • getSeed: synchronously retrieve the seed for an account-owned completed Midjourney image.

Generated media URLs are temporary. Download and store results in your own durable storage.

Links

License

Licensed under the Apache License, Version 2.0.

About

RunAPI Midjourney SDK for image generation, editing, image-to-video, first-video extension, and image helper workflows in JavaScript, Python, Ruby, Go, Java, and PHP

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages