stablediffusioncpp

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinDir

func BinDir() string

BinDir returns the directory where llmconfig manages stable-diffusion.cpp binaries.

func Extract

func Extract(archivePath string) error

Extract installs stable-diffusion.cpp from a local archive file (zip or tar.gz).

func FindBinary

func FindBinary() (string, error)

FindBinary returns the path to the sd-cli binary, preferring the managed bin dir.

func FindServer

func FindServer() (string, error)

FindServer returns the path to the sd-server binary, preferring the managed bin dir. It deliberately does NOT fall back to sd-cli: `up` launches this path with server-only flags, and starting sd-cli with those flags just fails confusingly.

func Install

func Install(asset *GithubAsset, onProgress func(downloaded, total int64)) error

Install downloads and extracts a release asset into BinDir(). onProgress is called with (downloaded, total) bytes.

func Version

func Version(binPath string) (string, error)

Version runs sd --version and returns the version string.

Types

type GithubAsset

type GithubAsset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

func PickAsset

func PickAsset(rel *GithubRelease, backend string) (*GithubAsset, error)

PickAsset selects the best release asset for the current OS/arch/backend. backend: "cuda", "metal", "cpu", "" (auto-detect)

type GithubRelease

type GithubRelease struct {
	TagName string        `json:"tag_name"`
	Assets  []GithubAsset `json:"assets"`
}

func LatestRelease

func LatestRelease() (*GithubRelease, error)

LatestRelease fetches the latest stable-diffusion.cpp release metadata from GitHub.

func ReleaseByTag

func ReleaseByTag(tag string) (*GithubRelease, error)

ReleaseByTag fetches release metadata for a specific stable-diffusion.cpp tag from GitHub.

Jump to

Keyboard shortcuts

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