[package]
name = "plakat"
version = "0.21.0"
edition = "2024"
rust-version = "1.85"
authors = ["Vladimir Ulogov <vulogov@gmail.com>"]
description = "Local text-to-image, style transfer, LoRA, upscale and color-key CLI built on candle"
license = "Unlicense"
readme = "README.md"
repository = "https://github.com/vulogov/plakat"
homepage = "https://github.com/vulogov/plakat"
keywords = [
  "stable-diffusion",
  "image-generation",
  "ai",
  "huggingface",
  "candle",
]
categories = ["command-line-utilities", "multimedia::images"]
# Don't ship local test outputs / scratch / large test fixtures with the
# crate. cargo also excludes target/ and gitignored files automatically.
# tests/fixtures/style_catalog/ is ~9 MB of JPEGs used by integration
# tests that run from the repo working tree; not needed by downstream
# users and would push the package past the 10 MB crates.io ceiling.
exclude = [
    "out/",
    "*.png",
    ".github/",
    ".vscode/",
    "tests/fixtures/",
    "**/.DS_Store",
]

[features]
# No backend selected by default. `cargo install plakat` builds a CPU-only
# binary that runs everywhere but is slow. For real perf, pick one:
#   macOS:        cargo install plakat --features metal
#   Linux+NVIDIA: cargo install plakat --features cuda
#   Linux+NVIDIA: cargo install plakat --features cudnn   (cuda + cuDNN)
default = []
cpu = []
cuda = ["candle-core/cuda", "candle-nn/cuda", "candle-transformers/cuda"]
cudnn = ["cuda", "candle-core/cudnn"]
metal = ["candle-core/metal", "candle-nn/metal", "candle-transformers/metal"]

[dependencies]
# CLI / UX
clap = { version = "4.5", features = ["derive", "env"] }
indicatif = "0.17"
console = "0.15"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

# Errors
anyhow = "1"
thiserror = "1"

# Hashing — v0.19: SHA-256 cache keys for the local prompt enhancer
# (--enhance-cache). Tiny dep, deterministic across rust versions /
# platforms — exactly what a disk-persisted cache needs.
sha2 = "0.10"

# Async + HTTP
tokio = { version = "1", features = [
  "rt-multi-thread",
  "macros",
  "fs",
  "io-util",
] }
reqwest = { version = "0.12", default-features = false, features = [
  "rustls-tls",
  "json",
  "stream",
] }
futures-util = "0.3"

# Serde
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.8"

# Image
image = { version = "0.25", default-features = false, features = [
  "png",
  "jpeg",
  "webp",
  "gif",
] }
# Direct PNG access for tEXt-chunk metadata writes (PNG metadata +
# JSON sidecar workflow). `image` doesn't expose the chunk API.
png = "0.18"
# imageproc: ControlNet Canny + future canny/sobel/HED annotators.
# default-features off to skip the optional rusttype/dynimage frills
# we don't need.
imageproc = { version = "0.25", default-features = false }

# RNG (only for cases where we want a host-side seed)
rand = "0.8"

# Hugging Face Hub
# default-features disabled so hf-hub doesn't pull in openssl via
# `native-tls`. Rustls keeps the dep graph C-free, which matters
# for cross-compiles (notably aarch64-unknown-linux-gnu) where a
# host-only OpenSSL install can't satisfy openssl-sys.
hf-hub = { version = "0.4", default-features = false, features = [
  "tokio",
  "rustls-tls",
] }
tokenizers = { version = "0.20", default-features = false, features = ["onig"] }

# Candle (inference)
candle-core = "0.10"
candle-nn = "0.10"
candle-transformers = "0.10"

# Paths / tempfiles
directories = "5"
tempfile = "3"

# HJSON for scenario files
deser-hjson = "2"

# v0.21: Bund scripting engine (RFC: Documentation/RFC_v0.21_BUND_SCRIPTING.md).
# We embed via `bundcore` rather than the `bund` binary crate (no [lib] target).
# Exact-version pins because the upstream uses wildcard requirements
# internally — pinning gives us a stable supply chain.
bundcore = "=0.7.0"
bund_language_parser = "=0.14.0"
rust_multistackvm = "=0.38.0"
rust_dynamic = "=0.49.0"
easy-error = "1"
# v0.21 phase 7: REPL line editor + history for `plakat run --repl`.
rustyline = "18"

[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
