Lineforge
A self-contained Windows batch image processing pipeline using a custom AI-directed Rust backend for vector tracing.
The Problem
I was training a FLUX LoRA using web-scraped black-and-white images, but the dataset was full of noise and varying quality. I needed a way to clean 300 images fast.
I realized the best way to clean up the artifacts in these images was to crank up the contrast, trace the bitmap to a vector (SVG) to eliminate the noise, and then convert it back to a raster format. But I didn't want to run a separate script for every step across hundreds of files. So, I directed an LLM to collect these scripts into one location and build a GUI where I could toggle parameters and process batches in one click. That was Lineforge version 1.
The Architecture & Direction
When another contributor provided a brand new UI for version 2, it prompted me to look at the backend. Version 1 worked, but it had baggage: it relied entirely on external software like ImageMagick and Inkscape to perform its duties.
I decided to see if I could organize a pair of models to perform a clean-room rewrite of those components. I wanted a native engine integrated directly into Lineforge so it wouldn't need external dependencies. I decided Rust was the best language for the job.
I structured Lineforge in two parts:
- A Python frontend using Pillow for fast, lightweight preprocessing (blurring, thresholding, contrast stretching, and square padding).
- A custom Rust tracing engine (`vpipe-cli`) that does the heavy lifting of turning pixels into vector paths.
The key to the implementation was the prompting strategy. I prompted the models for engine parts that matched the dependencies exactly, without providing the original C++ code to the authoring model. I ensured the new engine would function identically so I could just drop it in, make a slight adjustment to the Python script to call the Rust engine instead, and let it run. It worked almost immediately, with very few roadblocks.
What this proves
Lineforge proves that AI-assisted development isn't just for scripting; it can build highly performant, multi-language architectures. By identifying the bottleneck (vector tracing) and directing an LLM to build a compiled Rust solution, I was able to ship a professional-grade utility that operates orders of magnitude faster than a pure Python script.