Build Clipdrop

KINDAreplaces $15/mosaves $180/yrback to the verdict

0%0 of 20 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

A local workbench that takes an image, applies a masked operation such as removing an object or cleaning a blemish, upscales without visible tile seams, records every job with its settings so a result can be reproduced, and keeps the original untouched with a provenance record of what was changed.

estimated effort weekendthe files for this build are in the project pack

RuntimePython 3.12 orchestrating a local model serverModelsOpen inpainting and upscaling models run locally, with licences recordedMasksPainted masks with feathering, stored alongside the jobTilingOverlapping tiles with blended seams for large imagesStorageOriginals untouched, outputs plus a job record alongside

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Runs the orchestration, masking and tiling.

    Get it python.org or your package manager, then a virtual environment.

    Verify python3 --version prints 3.12 or higher

  2. have readyfree with suitable hardware; renting GPU time is the alternative

    Why Inpainting and upscaling are slow without one, which changes whether batch processing is practical rather than whether it works.

    Get it Check what you have and time one job before committing to a folder of two hundred images.

    Verify One job completes in a time you can multiply by your batch size

  3. have readyfree to download; commercial use terms vary

    Why They are the engine and their licences differ in ways that matter for commercial work.

    Get it Download the models you intend to use and read each licence for commercial use before using it rather than after.

    Verify Each model runs and its licence is recorded with a check date

  4. have readyfree

    Why Seams and blend errors are invisible on a busy photograph and unmistakable on a sky or a brick wall.

    Get it One photo with a large smooth sky and one with fine repeating texture. Keep both as fixtures.

    Verify Both are saved as fixtures

  5. decidefree

    Why It determines which model licences are acceptable and whether provenance should be embedded, and both are easier to decide before than after.

    Get it Write down whether the output is personal, commercial, or used in a context where an edit would mislead. One line, before Phase 5.

    Verify The decision is recorded and the licence check matches it

Data model

Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.

- images(id, source_path, width, height, content_hash, imported_at)
- jobs(id, image_id, kind, params_json, model_key, seed, mask_path, output_path, started_at, finished_at, state) · kind is inpaint, cleanup, upscale or relight
- provenance(job_id, note) · what was changed, in words, for the record
- models(key, name, source, licence, commercial_use, checked_on)
- A job records its model, seed and every parameter. The same inputs and the same job record must produce the same output.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
MODEL_ENDPOINTrequiredhttp://localhost:8188Your local model server. Nothing leaves the machine.
SOURCE_DIRrequired./images/sourceInput directory. Never written to.
OUTPUT_DIRrequired./images/outOutputs, masks and job records.
TILE_OVERLAP_PXrequired64Overlap between tiles when upscaling. Too small and blending has no room.
MEMORY_BUDGET_GBrequired8Used to derive tile size and batch concurrency. Measured rather than guessed.
DECLARED_USErequiredpersonalWhat outputs are for. Checked against model licences, and a mismatch blocks the job.

The build, in order

  1. One masked operation, reproducibly

    Removing an object works, and running the same job again produces the same image.

    1. Whichever you choose, running locally so images do not leave the machine.

      Files docs/setup.md

    2. Model, seed, parameters, mask. If a rerun needs something not recorded, the record is incomplete.

      Files src/jobs.py

    3. Byte comparison. Do this before building anything else on the pipeline.

      Files tests/test_determinism.py

    done when · tick each as it passes
    watch out
    • A pipeline with an unpinned seed or a nondeterministic sampler cannot reproduce a result, so a good output you want to adjust slightly has to be rediscovered by trial. Pin the seed, record it, and verify by running twice before building anything on top.
  2. Masks with edges that do not show

    The boundary between edited and original is invisible.

    1. Adjustable brush and feather radius, stored as an image alongside the job.

      Files src/mask.py

    2. Convert, blend, convert back. Gamma-space blending darkens the seam.

      Files src/composite.py

    3. On a gradient. This is where a hard mask or a gamma-space blend becomes obvious.

    done when · tick each as it passes
    watch out
    • Compositing through a hard-edged mask leaves a visible boundary, especially across a gradient like sky, and it is exactly the thing that makes an edit obvious. Feather the mask, and composite in linear light so the blend does not darken at the seam.
  3. Upscaling large images without seams

    A large photo upscales without a visible grid across it.

    1. A margin sized so blending has room. Compute tiles from the memory budget rather than a fixed number.

      Files src/tile.py

    2. A weighted blend across the margin, not a hard join.

      Files src/tile.py

    3. Both. A gradient exposes blending errors and texture exposes alignment errors.

    done when · tick each as it passes
    watch out
    • Tiling without overlap produces a visible grid, and overlapping without blending produces a doubled edge. Overlap by a meaningful margin and blend across it, then check on a sky gradient where any seam is unmistakable.
  4. Batch and queue

    A folder of images processes unattended without exhausting the machine.

    1. From what you measured, not from a core count. Image models are memory bound.

      Files src/queue.py

    2. Reported and skipped. One bad file must not cost an hour.

      Files src/batch.py

    3. So any output in a batch can be reproduced or adjusted individually.

      Files src/jobs.py

    done when · tick each as it passes
    watch out
    • Running several image jobs concurrently on a machine sized for one exhausts memory and takes the whole run down partway through, usually after an hour. Size the concurrency from actual memory use measured in Phase 3, and queue rather than parallelise beyond it.
  5. Provenance, which is the honest part

    You can say what was done to an image, and decide whether that travels with it.

    1. What changed, in words. Parameters are for reproduction; the note is for a person.

      Files src/provenance.py

    2. Every operation in order. This is the artefact that answers the question later.

      Files src/report.py

    3. In metadata or as a sidecar. Both are defensible; not deciding is not.

      Files docs/provenance.md

    done when · tick each as it passes
    watch out
    • An edited image is indistinguishable from a photograph, and in some contexts, including journalism, evidence and marketplace listings, presenting one as the other is a real problem rather than a stylistic question. Keep the record whatever you decide about embedding it, because you cannot reconstruct it later.
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more generative media.