LmCast :: Stay tuned in

Show HN: Txt2plotter – True centerline vectors from Flux.2 for pen plotters

Recorded: Jan. 23, 2026, noon

Original Summarized

GitHub - malvarezcastillo/txt2plotter

Skip to content

Navigation Menu

Toggle navigation

Sign in

Appearance settings

PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback


We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

malvarezcastillo

/

txt2plotter

Public

Notifications
You must be signed in to change notification settings

Fork
1

Star
39

39
stars

1
fork

Branches

Tags

Activity

Star

Notifications
You must be signed in to change notification settings

Code

Issues
0

Pull requests
0

Actions

Projects
0

Security
0

Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security

Insights

malvarezcastillo/txt2plotter

 mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History17 Commitsdocs/plansdocs/plans  examplesexamples  modulesmodules  teststests  .env.example.env.example  .gitignore.gitignore  .python-version.python-version  CLAUDE.mdCLAUDE.md  README.mdREADME.md  example_prompts.txtexample_prompts.txt  main.pymain.py  pyproject.tomlpyproject.toml  View all filesRepository files navigationREADMEtxt2plotter
Convert text prompts to pen-plotter-ready SVG files using AI image generation and centerline vectorization.
Pipeline

Prompt Enhancement - LLM rewrites your prompt for optimal line art generation
Raster Generation - Flux.2-dev generates a high-contrast line art image
Vectorization - Skeletonization and graph extraction produce clean paths
Optimization - Paths are merged, simplified, and sorted for efficient plotting
Output - Plotter-ready SVG with configurable dimensions

Examples

Plotted

Requirements

Python 3.10+
NVIDIA GPU with 24GB VRAM (RTX 3090/4090)
CUDA 12.x
OpenRouter API key for prompt enhancement
HuggingFace token with access to Flux.2-dev

Installation
git clone https://github.com/malvarezcastillo/txt2plotter.git
cd txt2plotter

# Create virtual environment
python3.10 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -e .

# Configure API keys
cp .env.example .env
# Edit .env with your keys
Usage
# Basic usage (A3 size)
python main.py "a geometric skull"

# Custom dimensions (A4)
python main.py "circuit board pattern" --width 297 --height 210

# Generate multiple variations
python main.py "mountain landscape" -n 5

# Reproducible generation with seed
python main.py "geometric pattern" --seed 42

# Generate 3 reproducible variations (uses seed, seed+1, seed+2)
python main.py "geometric pattern" -n 3 --seed 42

# Skip prompt enhancement
python main.py "minimalistic line drawing of a cat" --skip-enhance

# Batch mode: process multiple prompts from file
python main.py --batch prompts.txt -n 10
Batch File Format
Create a prompts.txt file (one prompt per line, supports comments):
# My prompts
"Minimalistic isometric impossible cube, thick black lines, technical drawing."
"Single continuous line drawing of a greyhound, Picasso style."

# This is also valid (no quotes)
A geometric skull with clean vector lines

Output is organized by prompt: output/<prompt_slug>/
Output

output/*.svg - Final plotter-ready SVGs
output/debug/ - Intermediate files for debugging:

01_prompt_enhanced.txt - Enhanced prompt
02_raster_raw.png - Generated image
02_raster_binary.png - Thresholded binary
03_skeleton.png - Skeletonized paths
03_graph_*.png - Graph visualization
03_paths.svg - Raw paths
04_optimized.svg - After optimization

License
MIT

About

No description, website, or topics provided.

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.


Activity
Stars

39
stars
Watchers

1
watching
Forks

1
fork

Report repository

Releases
No releases published

Packages
0

No packages published

Contributors
3

claude
Claude

nummy
nummy

malvarezcastillo
Martín Álvarez Castillo

Languages

Python
100.0%

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

This GitHub repository, maintained by Martín Álvarez Castillo, presents “txt2plotter,” a tool designed to transform text prompts into plotter-ready SVG files utilizing artificial intelligence. The core functionality hinges on a multi-stage pipeline encompassing prompt enhancement, raster image generation, vectorization, and optimization. The system leverages the Flux.2-dev AI model, alongside NVIDIA GPUs with substantial VRAM (24GB or greater), to achieve this conversion.

The pipeline initiates with prompt enhancement, where the LLM refines the user’s input to specifically generate high-contrast line art. This enhanced prompt then fuels the raster generation stage, utilizing Flux.2-dev to produce a raw image. The subsequent vectorization phase employs skeletonization and graph extraction to convert the raster into clean paths. Finally, the system optimizes these paths by merging, simplifying, and sorting them for efficient plotting. The output is delivered as plotter-ready SVG files, with configurable dimensions, organized within a directory structure reflecting the original prompt.

The system’s requirements are demanding, specifying Python 3.10+ and CUDA 12.x, alongside the NVIDIA GPU with sufficient VRAM. A key aspect of the tool is its reliance on external APIs, notably the OpenRouter API key for prompt enhancement and a Hugging Face token granting access to Flux.2-dev. The system provides a variety of command-line options, including scaling to different sizes (A3 or A4), generating multiple variations with a single seed value for reproducible output, or skipping prompt enhancement. Batch processing is also supported from a text file containing prompts. The generated files are organized for easy access containing the enhanced prompt, the raw raster, skeletonized paths and optimized paths.

The project code is structured with a `README.md` file outlining system basics, configuration and usage, along with “main.py” as the primary entry point. A "pyproject.toml" file manages project dependencies. The project incorporates a permissive MIT license, and includes the contributions of multiple developers, including the original maintainer, Claude, and nummy. The developer Martínez Álvarez Castillo has structured the workflow, to offer a flexible approach to converting a variety of text input prompts into machine-plot-ready images.