A vectorizer can return a complete SVG at the end of a request. That is enough for a download button, but it gives the UI no way to distinguish “still working” from “waiting on a connection that already closed.” For a preview, it helps to make completion an event in the protocol.
This example builds the streaming part in FastAPI. It uses a tiny fixture in place of GPU inference so you can test the viewer on any laptop. The fixture is deliberately not presented as model output.
What an editable result looks like
The example assets from Baidu’s Unlimited-SVG Space make a useful comparison. The sample PNG is 600 × 600 pixels. Its paired SVG has a 0 0 1024 1024 viewBox, seven path elements and three circles. Those elements can be selected and recoloured individually. The viewBox describes the coordinate space of the drawing, so it does not have to match the source image’s pixel dimensions.
These are measurements of one supplied pair, not a benchmark or a promise about file size.…