Build Clipdrop
KINDAreplaces $15/mosaves $180/yrback to the verdict
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.
Before step 1
Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.
- 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 - 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 - 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 - 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 - 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.
| Variable | Needed | Example | Where the value comes from |
|---|---|---|---|
MODEL_ENDPOINT | required | http://localhost:8188 | Your local model server. Nothing leaves the machine. |
SOURCE_DIR | required | ./images/source | Input directory. Never written to. |
OUTPUT_DIR | required | ./images/out | Outputs, masks and job records. |
TILE_OVERLAP_PX | required | 64 | Overlap between tiles when upscaling. Too small and blending has no room. |
MEMORY_BUDGET_GB | required | 8 | Used to derive tile size and batch concurrency. Measured rather than guessed. |
DECLARED_USE | required | personal | What outputs are for. Checked against model licences, and a mismatch blocks the job. |
The build, in order
One masked operation, reproducibly
Removing an object works, and running the same job again produces the same image.
Whichever you choose, running locally so images do not leave the machine.
Files
docs/setup.mdModel, seed, parameters, mask. If a rerun needs something not recorded, the record is incomplete.
Files
src/jobs.pyByte comparison. Do this before building anything else on the pipeline.
Files
tests/test_determinism.py
done when · tick each as it passeswatch 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.
Masks with edges that do not show
The boundary between edited and original is invisible.
Adjustable brush and feather radius, stored as an image alongside the job.
Files
src/mask.pyConvert, blend, convert back. Gamma-space blending darkens the seam.
Files
src/composite.pyOn a gradient. This is where a hard mask or a gamma-space blend becomes obvious.
done when · tick each as it passeswatch 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.
Upscaling large images without seams
A large photo upscales without a visible grid across it.
A margin sized so blending has room. Compute tiles from the memory budget rather than a fixed number.
Files
src/tile.pyA weighted blend across the margin, not a hard join.
Files
src/tile.pyBoth. A gradient exposes blending errors and texture exposes alignment errors.
done when · tick each as it passeswatch 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.
Batch and queue
A folder of images processes unattended without exhausting the machine.
From what you measured, not from a core count. Image models are memory bound.
Files
src/queue.pyReported and skipped. One bad file must not cost an hour.
Files
src/batch.pySo any output in a batch can be reproduced or adjusted individually.
Files
src/jobs.py
done when · tick each as it passeswatch 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.
Provenance, which is the honest part
You can say what was done to an image, and decide whether that travels with it.
What changed, in words. Parameters are for reproduction; the note is for a person.
Files
src/provenance.pyEvery operation in order. This is the artefact that answers the question later.
Files
src/report.pyIn metadata or as a sidecar. Both are defensible; not deciding is not.
Files
docs/provenance.md
done when · tick each as it passeswatch 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.
Model licences and serving othersproduct builder
Everything you use is something you are allowed to use for what you are doing.
Source, licence, commercial use, check date. One table, checked rather than assumed.
Files
docs/models.mdIf a model's licence does not cover your declared use, the pipeline refuses it.
Files
src/models.pyPer-user job limits and a queue sized to memory.
Files
src/server.py
done when · tick each as it passeswatch out- Model licences in this area vary considerably and several permit research use only, which is not the same as producing images for a client or a product listing. Check each one specifically against what you are doing rather than assuming that open weights mean unrestricted use.
That is the whole plan for Clipdrop. What it deliberately does not cover is below · check the gaps before you call it a replacement.
- Specialised hosted models trained for these tasks.
- Hosted processing and API capacity.
- Mobile capture with live preview.
- Any claim that an edited image is unmodified.
- specialized hosted models, API capacity, and polished mobile tools
- frontier proprietary models
- hosted GPU capacity
- licensed training data
- moderation and fast global delivery
- A history view showing an image's versions with the job that produced each
- Mask suggestion from a segmentation model, proposed rather than applied
- A comparison view that flips between original and result at full resolution
Need the files? The project pack on the verdict page hands your agent the whole brief · more generative media.