Skip to content

Latest commit

ย 

History

458 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โš”๏ธ Myth Forge

Describe a world. Get a legal 100-card Commander deck, printed as custom cards.

Fully local. Your GPU, your models, your machine โ€” no accounts, no API keys, nothing uploaded.

CI Release License: MIT Python 3.10+ Local first

Five commanders across five themed decks

Pick a commander, type a setting โ€” "a fae realm of canine trainers", "Prontera City at Halloween" โ€” and Myth Forge builds the 99, invents a name and flavor line for every card, paints custom art for each one locally, and composites it all into print-ready proxy frames. The rules text never changes; only the skin does, and every card carries the real card's name as a subtitle so nobody at the table has to guess what they're looking at.

It also measures. A simulation engine ships in the box and plays thousands of games to tell you a deck's power bracket, so "is this on level for my pod?" gets an answer instead of a vibe.


What you can do

๐Ÿƒ Build a deck Generate a themed 100-card Commander deck with custom AI art and printable proxies.
๐Ÿ” Analyze a deck Import one you already have to measure its real strength โ€” a simulation-grounded bracket and Power Profile โ€” then retheme it if you like.
๐Ÿ‚  Single card Proxy one real card with new art, or design a custom card from scratch: your own name, cost, rules and flavor.
๐ŸŽด My collection Browse, add and edit the cards you own. Powers collection-aware building and owned-card upgrade suggestions.

Gallery

The same commander (Syr Gwyn, Hero of Ashvale) rethemed into four worlds. The rules stay identical, but the name, art, flavor โ€” even the creature types in the rules text ("equip Cowboy", "equip Grim Warden") โ€” follow each world:

The same commander rethemed into four different worlds

The borderless treatment โ€” full-bleed art edge to edge, floating legend crowns, white title/type/ P&T in the official showcase convention, and the proxied card's real name as a subtitle:

Borderless cards across five decks and five card types

The commander wears your face โ€” upload 1โ€“5 photos and the commander (plus a few humanoid crew cards) renders with your likeness, in any theme and any art style. All five below came from one person's reference photos:

The same face as five different commanders across five themes

โ†’ Thirteen full themed decks in the gallery โ€” cyberpunk rave, hive city, ink-wash samurai, desert wasteland, crystal caves and more.

All art is generated locally (FLUX / SDXL via ComfyUI). The borderless cards were rendered against a locally-installed Card Conjurer's frame assets โ€” this repo bundles no Wizards-copyrighted frame artwork; the built-in frames ship with the app.


Quick start

๐Ÿš€ No big GPU? Start in "quick-look" mode

You do not need ComfyUI or a 24 GB card to see the core experience. Install, leave the Generate AI art toggle off on the Theme step, and Myth Forge still themes the whole deck (custom names, flavor text, creature-type reskins) and renders print-ready proxy frames using real Scryfall art. Only the custom AI art needs a GPU. Theming uses a local LLM, which can run a smaller model or on CPU.

1. Install (once, 2โ€“5 minutes)

python install.py

Windows users can double-click setup.bat instead. This installs Python and frontend dependencies, builds the frontend, and creates the directories the app needs.

2. Download models (once, optional โ€” skip for quick-look mode)

python download-models.py

Pick which checkpoints and LoRAs you want โ€” see MODELS.md.

3. Start it

python server.py

On Windows, double-click START MYTH FORGE.bat โ€” it brings up every backend the app needs (the theming LLM on :8010 and the strength engine on :8020) and then serves the app. manage.bat start does the same from a terminal.

Then open http://localhost:8000.

4. Check everything is up

python verify-setup.py

Or manage.bat status, which reports all four services.

Full instructions and troubleshooting: INSTALL.md ยท docs/MAINTENANCE.md


How a deck gets built

The decklist is generated up front, so the theme step can show the deck's real creature types for per-tribe reskinning.

1 ยท Commander & deck. Search any legendary creature, pick a power bracket (1โ€“5) and a playstyle (Aggro, Control, Lifegain, โ€ฆ or Auto) โ€” or switch to the Import tab to retheme a deck you already own. On continue, the 99-card list is built immediately. Cards are drafted by functional role (ramp / draw / removal / wipes / protection / finisher / theme), each window ordered by this commander's EDHREC lift rather than global popularity, gated by the bracket rules, and curve-aware so the deck can actually cast itself. Turn on Build from my collection and it prefers โ€” or with the strict option, uses only โ€” cards you own.

2 ยท Face. Optionally upload 1โ€“5 photos; humanoid card art will feature your likeness.

3 ยท Theme. A structured deck-idea intake: a Setting line plus genre / mood / lighting chips and optional inspirations. These feed a creative brief that keeps every concrete thing you named (a faithfulness contract) and invents extra detail to colour it โ€” how much is set by a Faithful โ†” Balanced โ†” Imaginative dial. Hit ๐Ÿ”ฎ Preview creative direction to see the resulting world bible โ€” your motifs with โœ“/โš  coverage, the invented signature details, the palette, sample themed cards โ€” and iterate before committing. With art on, ๐ŸŽจ Render these as real art paints those exact sample prompts (~2 min for 3 images, re-rollable) so you see the deck's look before the full run.

Also here: โœจ Auto-theme creature types (on by default) invents one theme-fitting replacement for every creature type and applies it uniformly to each card's name, art, type line and rules text โ€” so a Dragon never renders as a cat, and Knight โ†’ Cowboy turns "equip Knight {0}" into "equip Cowboy {0}". Override any individual type yourself. Plus frame style, border theme, custom mana pips, art-style preset and the art toggle.

4 ยท Deck. Browse all 100 cards with rendered frames; download a ZIP or a print-ready PDF. Re-roll three ways, each writing a new deck so the original is never lost:

  • ๐Ÿ”„ Rebuild โ€” re-roll the art only, keeping current names and prompts.
  • โœ๏ธ Retheme โ€” new names and new art, same cards and settings.
  • ๐ŸŽ›๏ธ Edit & Rebuild โ€” re-open the wizard with every input pre-filled; change anything, then build.

You can also multi-select cards and regenerate just those, with optional custom prompts.

Deep detail on the renderer, themer and image pipeline: docs/INTERNALS.md.


Import an existing deck

On the Commander step, switch to ๐Ÿ“ฅ Import a deck.

  • Archidekt โ€” paste the deck URL. Reliable; the importer honours the deck's own "included in deck" category flags rather than guessing from category names.
  • Moxfield โ€” paste the deck URL. Best-effort: Moxfield guards its API, so fall back to pasting.
  • Pasted decklist โ€” any text list (ManaBox, MTGO, Deckstats, paper). Quantities, 1x syntax, (SET) 123 suffixes, *CMDR* tags and zone headers are all understood; sideboard and maybeboard sections are ignored.

Notes. URL imports need a public deck. The commander is auto-detected from the source's commander zone; any decklist imports, though โ€” a 60-card list with no commander gets a display "face" auto-elected from the maindeck, and you can override it. Card names that can't be matched on Scryfall are reported by name and skipped rather than silently dropped. Imported decks and resolved card data are cached, so re-importing the same deck makes no network calls.

The imported list is immutable. Theming may re-invent every name and every image, but nothing in the pipeline is allowed to change which cards are in your deck โ€” rebuild, retheme and Edit & Rebuild all preserve it verbatim.


Measured, not guessed

Myth Forge builds and prints; the MythGauntlet engine at src/mythgauntlet/ measures. It simulates thousands of games to produce a six-axis Power Profile and a 1โ€“5 Commander bracket calibrated against author-labeled decks, plus an advisor that ranks upgrades from cards you already own.

On a finished or imported deck you get:

  • Bracket + Power Profile โ€” simulation-grounded, not a static heuristic score.
  • Upgrade advisor โ€” what to add from your collection, and what to cut. Cut candidates are chosen by redundancy (which functional role is over-supplied), not by which card is least popular โ€” because your least-played cards are usually your pet cards, silver bullets and vegetables.
  • Card impact โ€” would this one card help or hurt this deck, and why.
  • Duel โ€” a head-to-head 1v1 win rate against a friend's pasted decklist.
  • Deck health โ€” mana curve and colour sources: can this deck actually cast what it drafted?
  • Archetypes โ€” detected from the 99, not just the commander's oracle text, and gated on lift over each theme's base rate. Around half of real decks have no statistically-real archetype, and the panel says so rather than inventing one.
  • Off-meta read โ€” how far this deck sits from its commander's norm. A precon and a wild brew can rate the same bracket; this is the axis that separates them.

There is exactly one analysis implementation in this repo. When the engine isn't running, the UI says a number is unavailable rather than substituting a second, weaker guess.

โš ๏ธ The engine's ~30k compiled card semantics are NOT included. That store is still being trained and is withheld for now. The engine runs without it on Oracle-text fallbacks, at reduced fidelity. See docs/ENGINE_DATA.md for exactly what's missing and how to build your own. Engine internals live in docs/engine/.


Your collection

Myth Forge reads and writes the shared Myth Suite collection at Documents/MythSuite/collection.csv โ€” the same file MythScanner writes when you scan cards with a webcam.

Browse it as a binder with real card images, filter by colour / type / rarity / set / mana value, track printings and market value, and import a Moxfield CSV or plain decklist. A health check finds rows whose "name" is really a whole decklist line (13x Island (msh) 290 *F* [Land]) and offers to repair them โ€” every write leaves a backup, and Undo is one click.

That collection then feeds deck building (prefer or restrict to what you own) and the upgrade advisor. A Buildable panel ranks which commanders you own could make a real bracket 1โ€“3 deck.


Beyond the deck

โœจ Animated cards. Select cards and animate them into looping clips. Two independent effects: a local image-to-video model (LTX-Video or Wan 2.x, supply your own weights) animates only the art while each frame is recomposited through the normal renderer so the frame, text and mana symbols stay perfectly crisp โ€” and a procedural foil/holo sweep that needs no model at all and runs on CPU. Export as MP4, animated WebP or GIF, individually or as a ZIP. The static PNG stays the print.

๐Ÿ—ฟ 3D commander models. Commander art โ†’ background removal โ†’ Hunyuan3D v2 โ†’ a printable STL, scaled to ~60 mm.

๐Ÿ–จ๏ธ Export. Card PNGs as a ZIP, a print-ready PDF at 2.5โ€ณร—3.5โ€ณ @ 300 DPI (quantity-replicated, so all your basics are there), a decklist that round-trips back through Import, and a videos ZIP.


Requirements

Developed and tested on (full AI-art pipeline): NVIDIA RTX 3090 (24 GB), Ryzen 7 5800X3D, 32 GB RAM, Windows. Python 3.10+ (CI runs 3.12).

Build Time on a 3090
100 cards, FLUX Schnell ~18โ€“20 min
100 cards, FLUX Dev (premium) ~70โ€“75 min
Peak usage 2โ€“3 GB system RAM, 12โ€“14 GB VRAM
Other hardware Guidance
RTX 4080 (16 GB) FLUX Schnell only, ~20โ€“30 % slower
RTX 4070 (12 GB) FLUX Schnell, marginal fit
Smaller GPUs Fall back to Scryfall artwork (no local art generation)
Mac M-series CPU-only generation, much slower

Tuning and batch sizing: docs/HARDWARE_OPTIMIZATION_GUIDE.md.

Services

Service Port Purpose Required?
FastAPI / Uvicorn 8000 Backend API + serves the React frontend Yes
Local LLM gateway 8010 Card theming, names, flavor text, art prompts (qwen3:14b default) Yes
MythGauntlet engine 8020 Deck strength, bracket, upgrade advisor For analysis
ComfyUI 8188 AI image generation (FLUX / SDXL), animation, 3D For custom art

LLM backend. Myth Forge talks to an OpenAI-compatible endpoint โ€” by default a llama-swap gateway in front of llama-server (llama.cpp), which auto-loads GGUF models on demand and unloads them when idle. Prefer Ollama? Set MYTHFORGE_LLM_BACKEND=ollama โ€” the easiest path for a first install. MYTHFORGE_LLM_BASE overrides the endpoint URL.

The strength engine runs as a separate process on purpose: it holds the card-semantics store in memory (~50 s cold, ~1.4 s warm), so keeping it out of the web server keeps restarts fast. Starting the app auto-starts the LLM gateway and the engine if they aren't already listening; ComfyUI is only needed for image generation and starts separately (manage.bat โ†’ Option 3).

When something isn't working

Symptom Fix
"Port 8000 already in use" netstat -ano | findstr :8000 then taskkill /PID <pid> /F
ComfyUI not detected Ensure it's running on 8188; start it via manage.bat โ†’ Option 3
LLM backend not detected Simplest path: install Ollama, ollama pull qwen3:14b, ollama serve, set MYTHFORGE_LLM_BACKEND=ollama
Bracket / strength says "unavailable" The engine on :8020 is still loading (~50 s cold) or not running
Theming worked but there's no art ComfyUI needs --disable-async-offload โ€” see docs/INTERNALS.md
Server not responding Check the in-app ๐Ÿ“œ Logs viewer, or server.log

More by symptom: docs/MAINTENANCE.md ยท full menu reference: SCRIPTS.md


Project layout

mtg_deck_builder/
โ”œโ”€โ”€ server.py                 FastAPI backend โ€” every HTTP route, async build jobs, SSE progress
โ”œโ”€โ”€ deck_builder.py           Builds the 99 (lands/ramp/draw/removal/synergy/goodstuff)
โ”œโ”€โ”€ commander_analysis.py     Parses oracle text โ†’ detects mechanical themes
โ”œโ”€โ”€ playstyle.py              15 playstyle presets โ†’ theme keys + slot adjustments
โ”œโ”€โ”€ bracket.py                EDH bracket level definitions (1โ€“5)
โ”œโ”€โ”€ edhrec_lift.py            Per-commander EDHREC lift โ€” orders every candidate window
โ”œโ”€โ”€ deck_quality.py           Mana curve + colour-source measurement
โ”œโ”€โ”€ deck_themes.py            Archetypes detected from the deck's cards, gated on lift
โ”œโ”€โ”€ lift_stats.py             "How off-meta is this deck" โ€” the axis bracket doesn't measure
โ”œโ”€โ”€ theme_match.py            Offline reproduction of the theme queries, for owned-only builds
โ”œโ”€โ”€ themer.py                 Local LLM: themed names, art prompts, flavor text (batched)
โ”œโ”€โ”€ image_gen.py              ComfyUI: FLUX/SDXL/Krea/Qwen generation + face conditioning
โ”œโ”€โ”€ face_ref.py               Face upload management + humanoid card detection
โ”œโ”€โ”€ card_renderer.py          Pillow: composites frame PNGs into print-ready proxy cards
โ”œโ”€โ”€ cc_frames.py              Optional M15 / borderless frames from a local Card Conjurer
โ”œโ”€โ”€ card_video.py             Card animation (I2V motion) + procedural foil/holo
โ”œโ”€โ”€ model3d.py                Commander art โ†’ Hunyuan3D v2 โ†’ printable STL
โ”œโ”€โ”€ set_symbol.py             Per-deck set symbol, tinted by card rarity
โ”œโ”€โ”€ mana_pips.py              Optional deck-branded mana pips
โ”œโ”€โ”€ deck_import.py            Import/retheme an existing Moxfield/Archidekt/text deck
โ”œโ”€โ”€ collection*.py            Owned-card store, offline index, role pool, repair, stats
โ”œโ”€โ”€ exporter.py               ZIP + print-ready PDF export
โ”œโ”€โ”€ scryfall_client.py        Scryfall API wrapper (rate-limited, cached)
โ”œโ”€โ”€ src/mythgauntlet/         The simulation engine โ€” sim/, semantics/, ratings/, model/, agents/
โ”œโ”€โ”€ frontend/                 React + Vite SPA (built to frontend/dist, served by FastAPI)
โ”œโ”€โ”€ card_assets/              Bundled frame assets, fonts, mana symbols
โ”œโ”€โ”€ docs/                     Guides, specs and engine documentation
โ”œโ”€โ”€ tests/                    Pytest suite, incl. tests/engine/
โ”œโ”€โ”€ scripts/                  Dev tooling: corpus benchmarks, CCM training, offload harness
โ”œโ”€โ”€ utilities/                Sample-sheet generation, CUDA/DLL helpers
โ”œโ”€โ”€ START MYTH FORGE.bat      Windows one-click launcher (starts all backends + the app)
โ”œโ”€โ”€ manage.bat                Windows menu: start/stop/status/setup/models/ComfyUI
โ”œโ”€โ”€ setup.bat / install.py    First-time setup
โ””โ”€โ”€ verify-setup.py           Checks deps, frontend build, engine and services

Documentation

Setup & troubleshooting

Reference

The engine

Contributing

Run the tests with python -m pytest tests -q. CI runs the same suite plus a frontend build on every push.


The Myth Suite

Myth Forge is one of three tools sharing one collection file:

  • Myth Forge (this repo) โ€” build, theme, print and measure decks.
  • MythScanner โ€” scan your physical cards with a webcam; writes the shared collection.
  • MythGauntlet โ€” the trained card-semantics data the engine consumes (withheld while training).

Credits & legal

Bundled frame assets are sourced from wingedsheep/mtg-card-generator. Card data and images come from the Scryfall API at runtime. Optional official-style M15 frames are rendered from a Card Conjurer installation you supply yourself โ€” none of that artwork is in this repo, and it should not be committed here.

Myth Forge is an unofficial fan project, not produced by, endorsed by or affiliated with Wizards of the Coast. Magic: The Gathering and all associated names, rules text and designs are trademarks and copyrights of Wizards of the Coast. Cards produced by this tool are proxies for personal, non-commercial playtesting.

No AI model weights are distributed here โ€” you download those yourself, and several carry non-commercial terms, so check the license of each model you install.

Code is licensed under the MIT License. Full third-party attribution and the game-content notice: NOTICE.md.


Support

Myth Forge is free, open, and runs entirely on your own machine. If it saved you a stack of proxy cash, a coffee helps keep it improving.

Buy Me a Coffee

Myth Forge by OneMoreThan0 โš”๏ธ

About

Describe a world, get a legal 100-card EDH Commander deck as print-ready proxies with local AI art, names and flavor on the real rules. Plus a simulation engine that measures its power bracket by playing thousands of games. Runs entirely on your own machine: FastAPI, React, llama.cpp, ComfyUI.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages