cmd

package
v0.0.0-...-d397474 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cmd implements the malina CLI subcommands (install, system, model, sd, info) wired into urfave/cli.

Index

Constants

This section is empty.

Variables

View Source
var InstallCmd = &cli.Command{
	Name:  "install",
	Usage: "Install stable-diffusion.cpp libraries used by malina",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "version",
			Aliases: []string{"v"},
			Usage:   `version of stable-diffusion.cpp to install (e.g. "master-656-0e4ee04"; default is the malina-pinned version, pass "latest" to query the GitHub releases API)`,
			Value:   "",
		},
		&cli.StringFlag{
			Name:    "lib",
			Aliases: []string{"l"},
			Usage:   "path to stable-diffusion.cpp compiled library files",
			EnvVars: []string{"MALINA_LIB"},
		},
		&cli.StringFlag{
			Name:    "processor",
			Aliases: []string{"p"},
			Usage:   "backend to use (cpu, cuda, metal, vulkan, rocm)",
			Value:   "",
		},
		&cli.StringFlag{
			Name:  "os",
			Usage: "operating system to install for (linux, windows, darwin)",
			Value: runtime.GOOS,
		},
		&cli.BoolFlag{
			Name:    "upgrade",
			Aliases: []string{"u"},
			Usage:   "upgrade existing installation",
			Value:   false,
		},
		&cli.BoolFlag{
			Name:    "quiet",
			Aliases: []string{"q"},
			Usage:   "suppress output during installation",
			Value:   false,
		},
	},
	Action: func(c *cli.Context) error {
		return runInstall(c)
	},
}

InstallCmd installs stable-diffusion.cpp shared libraries into a local directory.

View Source
var ModelCmd = &cli.Command{
	Name:  "model",
	Usage: "Manage stable-diffusion model bundles",
	Subcommands: []*cli.Command{
		modelListCmd,
		modelInfoCmd,
		modelPullCmd,
	},
}

ModelCmd manages stable-diffusion model bundles (list / info / pull).

A "bundle" is the set of files (diffusion model, VAE, text encoders, etc.) that stable-diffusion.cpp needs to construct a single Context. Curation lives in pkg/download/bundle.go; kronk and other downstream consumers may layer their own catalog on top of this one.

View Source
var SDCmd = &cli.Command{
	Name:  "sd",
	Usage: "Run stable-diffusion.cpp commands",
	Subcommands: []*cli.Command{
		sdEncodeCmd,
	},
}

SDCmd groups stable-diffusion subcommands under "malina sd". Subcommand implementations for generation (txt2img, img2img) land in follow-on milestones.

View Source
var SystemCmd = &cli.Command{
	Name:  "system",
	Usage: "Show stable-diffusion.cpp / system information",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "lib",
			Aliases: []string{"l"},
			Usage:   "path to stable-diffusion.cpp compiled library files",
			EnvVars: []string{"MALINA_LIB"},
		},
	},
	Action: func(c *cli.Context) error {
		return runSystemInfo(c)
	},
}

SystemCmd shows information about the host environment and the loaded stable-diffusion.cpp library.

Functions

func ShowInfo

func ShowInfo(c *cli.Context) error

ShowInfo prints the malina banner and a short tagline.

Types

This section is empty.

Jump to

Keyboard shortcuts

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