Alright, no sugarcoating — this thing takes in your neural network JSON, runs it through a Node.js backend, cooks it with a Python-LaTeX script, and spits out a clean PNG diagram. Minimal effort, max clarity.
- You send a JSON with your model layers.
- Backend runs a Python script using PlotNeuralNet (built on LaTeX/TikZ).
- It gives you back a crispy PNG diagram. Use it wherever you want.
- Windows 10/11 (Mac/Linux work too, but commands vary)
- Python 3.8+ (works well with 3.9)
- Node.js 14+
- LaTeX (MiKTeX or TeX Live — must include
pdflatex) - ImageMagick (with
magickcommand and PDF support) - Git (optional, if you're cloning)
Using git:
git clone https://github.com/guider23/PlotNeuron
cd PlotNeuronOr unzip the folder and cd into it.
No pip installs. Pure standard library — simple and clean.
npm installpdflatex --version- Install from here
- During install, check:
- "Install legacy utilities (e.g., convert)"
- "Install development headers for C/C++"
- Confirm it works:
magick --version- Still no PNG? Install Ghostscript and add to PATH for PDF support.
node server.jsSend a JSON to http://localhost:3000/generate. Example:
{
"layers": [
{ "type": "Conv", "filters": 64, "position": "(0,0,0)" },
{ "type": "Pool", "position": "(2,0,0)" },
{ "type": "Dense", "units": 128 }
]
}Use Postman, curl, whatever you vibe with.
Using curl:
curl -X POST http://localhost:3000/generate -H "Content-Type: application/json" -d "{\"layers\":[{\"type\":\"Conv\",\"filters\":64,\"position\":\"(0,0,0)\"},{\"type\":\"Pool\",\"position\":\"(2,0,0)\"},{\"type\":\"Dense\",\"units\":128}]}"Open:
http://localhost:3000/outputs/main.png
Boom. There’s your architecture.
- Dynamic JSON Handling — No static files. Backend takes your live JSON and builds LaTeX on the fly.
- Absolute Paths — No “where’s my file” errors. Full paths passed to Python.
- Clear Errors — Any LaTeX/ImageMagick fails? The server yells clearly, not cryptically.
- FileNotFoundError — Check your paths and installed stuff.
- LaTeX/ImageMagick not working — Confirm they're in your PATH.
- No PNG Output — Server logs are your map.
- Want new layer types? Hack
scripts/generate.py, insidegenerate_arch_from_json(). - Wanna go big? Check out the OG repo: PlotNeuralNet
That’s it. Clean project, no clutter. You know the vibe. Just clone → install → run → post → PNG. If anything's off, read the console — it talks back.