imagegen

package
v0.0.0-...-d421f4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

fonts

NotoEmoji-Medium.ttf comes from https://fonts.google.com/noto/specimen/Noto+Emoji. It is used under the Open Font License.

Documentation

Overview

Package imagegen runs an image generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawLabelsOnImage

func DrawLabelsOnImage(img *image.NRGBA, meme string)

DrawLabelsOnImage draw text on an image.

Types

type Options

type Options struct {
	// Remote is the host:port of a pre-existing server to use instead of
	// starting our own.
	Remote string
	// Model specifies a model to use. Use "python" to use the python backend.
	// "python" is currently the only supported value.
	Model string
	// contains filtered or unexported fields
}

Options for New.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session manages an image generation server.

func New

func New(ctx context.Context, cache string, opts *Options) (*Session, error)

New initializes a new image generation server.

func (*Session) Close

func (ig *Session) Close() error

func (*Session) GenImage

func (ig *Session) GenImage(ctx context.Context, prompt string, seed int) (*image.NRGBA, error)

GenImage returns an image based on the prompt.

Use a non-zero seed to get deterministic output (without strong guarantees).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL