Skip to main content

AIsketcher

PyPI version GitHub tag CI

Turn one sketch into traceable design directions—not disconnected files you can never reproduce.

AIsketcher is a model-independent Python toolkit for seed scouting, controlled variation, and replayable visual studies. It records the input, control, prompt provenance, actual seeds, selected parent, model revisions, lineage, and hashes around a local or hosted image backend—now with restored classic Canny quality, native Apple Silicon MLX, and a zero-dependency stdio MCP server.

18-second animated AIsketcher v0.5 demo showing Prepare, 4-Seed Scout, Structure-Locked Vary, Strict Replay, and MCP

18-second walkthrough built from real Apple M6 outputs · Prepare → 4-Seed Scout → Structure-Locked Vary → Strict Replay + MCP

Documentation · 한국어 빠른 시작 · Apple Silicon MLX · MCP server · Model guide · PyPI · Feedback

Try the real workflow in seconds

pip install aisketcher
aisketcher try

This opens a bilingual, interactive tour of a real recorded study on 127.0.0.1. It installs no Torch, Gradio, Diffusers, MLX, or model weights, sends no telemetry, and makes no external network request. Select each direction to inspect its seed and evidence; press Ctrl+C in the terminal when finished.

That fast first run is deliberate. A 16–35 GB checkpoint download should not be the price of discovering what the package does.

Restored classic visual quality (v0.5)

Between v0.2 and v0.4, swapping the 2023 Lykon/DreamShaper stack for raw stabilityai/stable-diffusion-xl-base-1.0 produced washed-out, muted Canny renders. Version 0.5.0 restores vivid sketch-to-illustration quality by replacing raw sdxl-base-1.0 with pinned dreamshaper-canny@1 (Lykon/dreamshaper-8 + lllyasviel/sd-controlnet-canny, 3.58 GB) as the restored classic Structure default, alongside juggernaut-xl-canny@1 (Aesthetic XL, 9.44 GB) and mlx-flux2-klein-edit@1 (Apple Silicon MLX, 15.98 GB). Legacy sdxl-canny-lite@1 and sdxl-canny@1 stay pinned for strict replay of earlier manifests.

Five-panel visual quality restoration comparison at heritage seed 6764547109648557242: Input Sketch, 2023 Lykon/DreamShaper, v0.2–v0.4 SDXL Base regression, v0.5 DreamShaper 8 Canny, and v0.5 MLX FLUX.2 4-bit

Same heritage seed 6764547109648557242 (768×576, Canny 140/160): Input Sketch · 2023 Lykon/DreamShaper · v0.2–v0.4 SDXL Base regression · v0.5 DreamShaper 8 Canny · v0.5 MLX FLUX.2 4-bit

Four-seed scout contact sheet from restored dreamshaper-canny@1 on Apple M6 MPS preserving the sketch silhouette and crisp enamel detail across all four seeds

Restored default dreamshaper-canny@1 · 4-seed scout on Apple M6 MPS (35 steps PNDM · 35.7 s/img warm · 2.86 GB peak RSS · strict replay verified)

What AIsketcher adds above a model

prepare → explore → pick → vary → export → replay
  • Comparable directions: generate 1, 4, or 8 candidates from an explicit seed plan instead of repeatedly changing an undocumented random seed.
  • A recorded decision: keep the chosen parent, variation strength, and structure locks as lineage rather than relying on filenames.
  • Reproducible handoff: export images, recipe, exact seeds, model revisions, prompt provenance, runtime, and hashes in one portable study.
  • Backend independence: use the built-in Diffusers, FLUX.2, or Apple Silicon MLX adapters—or implement the small Backend protocol for a hosted, cloud, or in-house generator.
  • Local-first inspection & agent tooling: inspect studies in localhost Studio or drive the full lifecycle from coding agents over zero-dependency stdio MCP.

Local Studio

Actual AIsketcher Studio showing a source sketch, selected result, four recorded directions, prompt, structure setting, and seed evidence

Actual local Studio with the bundled, hash-verified Guided Study · real source, four outputs, seeds, selection, and manifest · no model download

Simple mode starts with Quick preview · 1 so a new user can validate one real result before paying for a four- or eight-seed search. Generation time grows roughly with the number of requested outputs. The packaged app binds to 127.0.0.1 and public sharing is disabled.

Choose the model by its job

There is no honest universal default. AIsketcher makes every preset role explicit:

Preset / Role Best for Download Limit
Restored Classic Structure · dreamshaper-canny@1 vivid sketch-to-illustration rendering with strict Canny line locking; fast multi-seed MPS & CUDA scouting 3.58 GB SD 1.5 resolution class (768×768 default, max 1024)
Apple Silicon MLX · mlx-flux2-klein-edit@1 native Metal/MLX 4-step reference editing on Apple Silicon without CUDA (4-bit default, 8-bit option) 15.98 GB reference-image editing, not Canny; exact line locking is not guaranteed
Aesthetic XL · juggernaut-xl-canny@1 fine-tuned 1024 px SDXL Canny rendering replacing washed-out sdxl-base-1.0 9.44 GB single-image recommended on 24 GB MPS; full multi-seed on CUDA
Fast Edit (CUDA) · flux2-klein-edit@1 photo restyling, flexible sketch interpretation, and instruction edits on a 16 GB NVIDIA T4 16.23 GB requires CUDA; reference-image editing, not Canny
Legacy Replay · sdxl-canny-lite@1 / sdxl-canny@1 strict replay of historical v0.2–v0.4 manifests 7.26 / 9.44 GB raw sdxl-base-1.0 aesthetic regression; kept for replay compatibility

Z-Image Turbo + Union 2.1 Lite and Qwen Image Edit 2509/2511 remain tracked candidates until they beat existing paths under the published multi-input, four-seed benchmark gate. See the model decision guide.

Apple Silicon MLX measured speed & memory

Four-seed scout contact sheet from Apple Silicon MLX mlx-flux2-klein-edit@1 (4-bit, Metal 4) turning the pencil sketch into detailed handcrafted wood and enamel dioramas

Apple Silicon MLX mlx-flux2-klein-edit@1 (4-bit default) · 4-seed scout on Apple M6 Metal 4 (4 steps · 10.10 GB MLX peak · strict replay verified)

Measured on Apple M6 (Mac18,5, 12-core GPU, 24 GB Unified Memory, Metal 4), macOS Darwin 27.0.0, Python 3.12.15, torch 2.15.0, diffusers 0.43.0, mlx 0.32.5, mflux 0.24.0 (docs/assets/pocket-kingdom/source.png prepared at 768×576, Canny 140/160, heritage seed 6764547109648557242 + 4-seed scout + 2 subtle structure-locked variations + Studio.replay(..., mode="strict")):

Preset Backend / Device Download Steps / Precision Cold + 1st Warm (per image) Vary (per image) Peak Memory Strict Replay
dreamshaper-canny@1 Diffusers / MPS 3.58 GB 35 steps PNDM · fp16 + fp32 VAE 46.2 s 35.7 s (4 imgs: 142.6 s) 19.3 s 2.86 GB peak RSS Pass (0 drift)
mlx-flux2-klein-edit@1 (4-bit, default) MFLUX / MLX Metal 4 15.98 GB 4 steps FlowMatch · 4-bit 240.3 s* 61.6 s (denoise 28–36 s; 4 imgs: 246.5 s) 55.7 s 10.10 GB MLX peak (2.78 GB RSS) Pass (0 drift)
mlx-flux2-klein-edit@1 (8-bit) MFLUX / MLX Metal 4 15.98 GB 4 steps FlowMatch · 8-bit 81.5 s 97.7 s (4 imgs: 390.7 s) 82.0 s 11.61 GB MLX peak (2.78 GB RSS) Pass (0 drift)
juggernaut-xl-canny@1 Diffusers / MPS 9.44 GB 30 steps UniPC · fp16 + fp32 VAE 33.0 s (1 img) Single-image recommended on 24 GB MPS** — — Pass

* 4-bit cold time includes first-ever Metal shader compilation and on-load 4-bit quantization; subsequent runs use the compiled cache (see 8-bit 81.5 s cold load).
** On 24 GB MPS, per-seed MPS pipeline reload isolation can pressure 24 GB unified memory on multi-seed runs; use dreamshaper-canny@1 or mlx-flux2-klein-edit@1 for fast multi-seed Apple Silicon scouting, and juggernaut-xl-canny@1 on CUDA or single-image MPS renders.

Read the full Apple Silicon MLX guide for 4-bit/8-bit examples, cache reuse, and four-seed visual QA contact sheets.

3-line MCP setup (Claude Code · Codex CLI · Copilot CLI)

AIsketcher ships a zero-dependency stdio MCP server (aisketcher mcp) using only the Python standard library and AIsketcher core. It stays offline by default and confines file access when --workspace-dir is passed.

pip install aisketcher
claude mcp add aisketcher -- aisketcher mcp --workspace-dir .   # Claude Code
codex mcp add aisketcher -- aisketcher mcp --workspace-dir .    # Codex CLI

For GitHub Copilot CLI (~/.copilot/mcp-config.json) or JSON-configured clients:

{
  "mcpServers": {
    "aisketcher": {
      "command": "aisketcher",
      "args": ["mcp", "--workspace-dir", "."]
    }
  }
}

6 exposed MCP tools: aisketcher_list_presets, aisketcher_prepare_sketch, aisketcher_explore_seeds, aisketcher_vary_candidate, aisketcher_inspect_manifest, and aisketcher_replay_manifest. See the complete MCP server guide.

Install only the layer you need

The install identifier, Python import, and CLI are lowercase aisketcher.

# Lightweight SDK + zero-download tour + stdio MCP server
python -m pip install "aisketcher==0.5.0"

# Local Gradio Studio + bundled Guided Study
python -m pip install "aisketcher[demo]==0.5.0"

# Native Apple Silicon MLX backend (macOS arm64)
python -m pip install "aisketcher[mlx]==0.5.0"

# Studio plus local Diffusers model runtimes
python -m pip install "aisketcher[local,demo]==0.5.0"

# Full Apple Silicon bundle (Diffusers + MLX + Studio)
python -m pip install "aisketcher[local,mlx,demo]==0.5.0"

Initialize the versioned YAML settings ledger once, then launch Studio:

aisketcher init
aisketcher studio

Model downloads begin only after you choose a concrete model and review its size, immutable revisions, cache destination, and licenses. The packaged CLI checks device support, minimum VRAM, and free cache space before a multi-GB transfer. Unsupported CPU/MPS combinations fail before downloading. English setup no longer pulls the separate 1.9 GB Korean→English helper; Korean Studio prepares that pinned helper only for the Korean workflow.

Guided Study, aisketcher try, and aisketcher mcp --backend fake work on CPU. On Apple Silicon, use dreamshaper-canny@1 (MPS) or mlx-flux2-klein-edit@1 (native MLX); flux2-klein-edit@1 requires CUDA. Use Stop rather than refreshing during generation or model preparation.

Python workflow

from aisketcher import Intent, PresetManager, SeedPlan, Studio

# Also try "dreamshaper-canny@1" (restored classic Canny) or
# "mlx-flux2-klein-edit@1" (Apple Silicon MLX, 4-bit default).
preset = "flux2-klein-edit@1"
models = PresetManager()
plan = models.plan_install(preset)
print(plan.download_bytes, plan.items, plan.license_notice)

# Continue only after reviewing the immutable repositories and licenses.
if not plan.installed:
    models.install(preset, confirm=True)

studio = Studio.from_preset(preset, device="auto", preset_manager=models)
prepared = studio.prepare("sketch.jpg")

study = studio.explore(
    prepared,
    intent=Intent(
        prompt="A playful paper-cut fantasy kingdom",
        profile="graphic_design",
        structure="balanced",
    ),
    outputs=4,
    seed_plan=SeedPlan.scout(4),
)

selected = study.pick(1)
variations = studio.vary(
    selected,
    outputs=4,
    strength="subtle",
    locks=("structure",),
)

variations.export("design-study")
report = studio.replay("design-study/manifest.json", mode="strict")

For network- and model-free API tests, use Studio(FakeBackend(), preset="sdxl-canny-lite@1"). The fake backend is a deterministic test double, not a claim about creative quality.

The high-level workflow stays the same for a custom backend. Implement name, capabilities, and generate(request), then pass the object to Studio(your_backend, preset=...). Read the complete SDK workflow and export/replay contract.

Seeds are evidence, not a style preset

A seed is meaningful only with the same model revision, resolved recipe, prompt, input, and runtime. AIsketcher therefore recommends observable properties such as structure similarity, edge cleanliness, and diversity; it does not claim that one seed is universally beautiful. Human selection remains part of the manifest.

Korean prompts

Studio preserves the exact Korean brief and prepares separate model-facing English with a pinned local helper. The original, translated text, helper ID, immutable revision, and refinement history are recorded as prompt provenance. This improves consistency but is not a promise that every Korean phrase will translate perfectly.

Development

python -m pip install -e ".[dev,docs,demo]"
python -m pytest
python -m ruff check src examples tests
python -m mypy src/aisketcher
mkdocs build --strict
python -m build
python -m twine check dist/*

Normal CI and the browser suite are model-free and never download weights. Actual model promotion requires the separate benchmark gate documented above. Merging reviewed documentation to main automatically refreshes GitHub Pages; publishing a versioned GitHub Release publishes the same immutable README to PyPI through Trusted Publishing.

License

Source code and documentation text are licensed under the MIT License. Images, drawings, generated derivatives, and other artwork are excluded; read the artwork notice before reuse.

Metadata

Release files for AIsketcher 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AIsketcher 0.5.0
File Size Uploaded Provenance Actions
aisketcher-0.5.0.tar.gz 3.7 MB With provenance Details for aisketcher-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AIsketcher 0.5.0
File Interpreter ABI Platform Actions
aisketcher-0.5.0-py3-none-any.whl Python 3 none any Details for aisketcher-0.5.0-py3-none-any.whl

Total release size: 7.3 MB

Release files / aisketcher-0.5.0.tar.gz

Download URL aisketcher-0.5.0.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
a8544ededef28755604fe85f085dc5ea6a80b2a132eae341c4b6e3bcf56fa9b4
BLAKE2b-256 checksum
How to use checksums
f25b85062af7855e6911b2425e9be33368873490ed2d57dc6e00726894c86219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / aisketcher-0.5.0-py3-none-any.whl

Download URL aisketcher-0.5.0-py3-none-any.whl
Size 3.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bb54c62f622ccc3686012562f9a776e78c02a7daf48bb819091841caeecec0db
BLAKE2b-256 checksum
How to use checksums
a41df89eefb3ccfccea94e9eafbdd731a3da50d8891c272ac1e1b60f7dd90522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for AIsketcher 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aisketcher-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page