IOPaint Installation

← Back to Installation

IOPaint is a separate program (not part of JuSPICE) that fills in missing background pixels in an image. JuSPICE calls it every time it augments images for synthetic-data generation — that is any of the Aug, PB, PB_NonGauss, SDiff, or DCGAN methods, i.e. any spice.synth_generation.generate() call using one of those method_name values (used in the example_Aug, example_PB, example_SDiff, and example_DCGAN notebooks). If you never call any of those methods, skip this page.

IOPaint needs its own specific versions of diffusers, huggingface_hub, and torch — versions that clash with the ones JuSPICE’s own [dl] extra installs. To avoid that clash, IOPaint gets its own environment, venvs/.venv_iopaint, completely separate from JuSPICE’s own venvs/.venv. On disk, this environment takes about 1.2 GB for the libraries themselves. The first time IOPaint actually runs, it also downloads its default background-fill model (called LaMa) automatically — about 0.2 GB more. (Both numbers come from a test installation by the developer; your own numbers may differ a little, as library and model versions change over time.)

Using it with JuSPICE

Nothing further is needed — run your notebook or script as usual, from JuSPICE’s own venvs/.venv:

spice.synth_generation.generate(
    config=config,
    input_dataset=dataset,
    method_name="Aug",  # or "PB", "PB_NonGauss", "SDiff", "DCGAN"
    repo_root=repo_root,
    N_images=N_images,
    device=device,
)

JuSPICE finds venvs/.venv_iopaint’s iopaint program at a fixed path relative to the JuSPICE package itself. This works no matter which folder you launch the notebook from, and no matter what’s on your PATH — the two environments never both need to be active at the same time (only venvs/.venv does), because iopaint runs as a separate program (a subprocess), not as an imported Python package (see How this works below for why that’s what makes this possible). If iopaint can’t be found at that path, you get a clear error naming the exact uv sync command above.

See also