Skip to content

hongliang5316/midjourney-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

List

midjourney-go

midjourney-go is a Go client library for accessing the Midjourney-Bot API.

It is designed very simply and is lightweight with no additional logic. It belongs to a very low-level library, so you can use it to do anything.

If you want to build your own midjourney apiserver, take a look at this midjourney-apiserver.

List

Installation

midjourney-go is compatible with modern Go releases in module mode, with Go installed:

go get github.com/hongliang5316/midjourney-go@v0.0.1

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/hongliang5316/midjourney-go/midjourney"

and run go mod tidy without parameters.

List

Simple Usage

Construct a new Midjourney client, then use the various commands on the client to access different parts of the Midjourney-Bot API. For example:

client := midjourney.NewClient(&midjourney.Config{
    UserToken: "your token",
})

// imagine
if err := client.Imagine(context.Background(), &midjourney.ImagineRequest{
    GuildID: "",
    ChannelID: "",
    Prompt: "",
}); err != nil {
    log.Fatalf("Call client.Imagine failed, err: %+v", err)
}

List

Features

Currently, only some commands have been implemented. All commands will be implemented in the future. If you are interested, please submit a pull request or issues.

  • /imagine

  • /upscale

  • /variation

  • /describe

  • /blend

  • /reroll

List

License

This library is distributed under the BSD-style license found in the LICENSE file.

List

Changelog

v0.0.1 (20/06/2023)

  • Complete the basic functions
    • Support for Imagine api
    • Support for Upscale api
    • Support for Variation api
    • Support for Describe api

List