Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
/ mittelweg Public archive

( Discontinued, not allowed by Midjourney ToS) The golang package for managing Midjourney via the Discord API.

License

Notifications You must be signed in to change notification settings

bernardoforcillo/mittelweg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The golang package for managing Midjourney through Discord API.

The mittelweg package provides a Golang SDK for managing Midjourney through Discord API. It is in development.

Installation

go get github.com/bernardoforcillo/mittelweg

Usage

For use in your project, add the mittelweg package to your project. As follows:

import "github.com/bernardoforcillo/mittelweg"

How to initialize a client

client := midjourney.NewMidjourneyClient("your token", "channel id")

How to generate an image

The Imagine command is used to generate an image. It takes two arguments: a string that is the prompt for the image, and a boolean that force the execution to wait until the image is generated.

generatedImage, err := client.Imagine("prompt", waitUntilGenerated)
if err != nil {
    log.Fatalf("call client.Imagine failed, err: %+v", err)
}

How to upscale an image

The Upscale command is used to upscale an image. It takes two arguments: the index of the image to upscale, the index must be between 0 (included) and 4(excluded). and a boolean that force the execution to wait until the image is generated.

upscaledImage, err := generatedImage.Upscale(index, true)
if err != nil {
	log.Fatalf("call.Upscale failed, err: %+v", err)
}

SearchGeneratedMessage and SearchUpscaledMessage are two utility functions that can be used to search for messages in a channel.

License

This project is licensed under the MIT license. See the license.md file for more details.

About

( Discontinued, not allowed by Midjourney ToS) The golang package for managing Midjourney via the Discord API.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages