Use runapi-midjourney for Midjourney image generation, editing, image-to-video, first-video extension, image-to-prompt, prompt shortening, and seed lookup in Ruby applications and workers.
gem install runapi-midjourneyrequire "runapi/midjourney"
client = RunApi::Midjourney::Client.new
result = client.text_to_image.run(
model: "midjourney-v8.1",
prompt: "A cobalt blue ceramic vase on white marble"
)
puts result.images.first.urlUse create, get, and run for text_to_image, edit_image, image_to_video, and extend_video. extend_video accepts the task ID of an account-owned completed direct image-to-video task and continues its first video; extension tasks cannot be chained. Use run directly for image_to_prompt, shorten_prompt, and get_seed. Generated media URLs are temporary and should be stored in durable storage.
- Model page: https://runapi.ai/models/midjourney
- Product docs: https://runapi.ai/docs#midjourney
- SDK docs: https://runapi.ai/docs#sdk-midjourney
- V8.1 details: https://runapi.ai/models/midjourney/v8.1
- Image editing details: https://runapi.ai/models/midjourney/edit-image
- Image-to-video details: https://runapi.ai/models/midjourney/image-to-video
- Repository: https://github.com/runapi-ai/midjourney-sdk
Licensed under the Apache License, Version 2.0.