The preceding subsections vary what a model is given and measure what it returns as a number. This one asks a different question of the same machinery: given one field of a real diagnostic slide, what else can be produced from it that is equally well-formed?
| item | value |
| slide | TCGA colon adenocarcinoma, H&E, whole-slide image |
| GDC file 35c1e23c-8adb-4a7f-865f-be1d6e10b3ef, \(7.6\) MB | |
| pyramid level read | \(2500 \times 2177\) RGB (tifffile; OpenSlide unavailable) |
| tissue detection | luminance below \(0.88\), \(64\)-pixel uniform filter, |
| density threshold \(0.6\), computed with cupy on the GPU | |
| field selected | \(1024 \times 1024\) at \((737,576)\), resampled to \(512 \times 512\) |
| segmentation | Segment Anything, ViT-B, \(32\) points per side, |
| IoU threshold \(0.82\), stability \(0.88\), minimum region \(150\) px | |
| generative model | Stable Diffusion v1.5, fp16, DDIM scheduler, one H100 |
| image-to-image | strength \(0.62\), guidance \(8.5\), \(40\) steps, seed \(0\) |
| inversion | DDIM inverse, \(50\) steps, null text; resampled at guidance \(7.5\) |
| inpainting | Stable Diffusion inpainting v1.5, guidance \(8.0\), \(30\) steps |
| software | diffusers, torch 2.6.0, segment-anything, cupy |
Nothing here is simulated. The input is one field of a real diagnostic slide, selected automatically as the densest tissue region of the whole-slide image.
Segment Anything returns \(35\) pieces covering \(97.5\%\) of the field. Their areas span five orders of magnitude, from \(219\,502\) pixels (\(83.7\%\) of the field) down to \(6\). The areas also sum to more than the field: the six largest alone account for \(149\%\) of it, because the segmentation is a set of overlapping proposals rather than a partition. Which of the overlapping pieces is “the object” is not decided by the model; it is decided by whatever consumes its output.
At strength \(0.62\) the sampler starts from the encoded section and denoises under a text condition. Five conditions were used; each produces a complete, internally coherent image:
| condition | what the field becomes |
| a coral reef underwater | reef structure at the scale of the glands |
| an aerial view of a city at night | street grid following the stromal boundaries |
| a nebula in deep space | emission structure on the nuclear density |
| a stained glass window | leaded panels on the tissue architecture |
| lichen on rock | thallus growth on the same outlines |
The spatial layout survives — glands remain where glands were, stroma where stroma was — while what occupies that layout is set entirely by the text. The section supplies the arrangement; the prompt supplies what the arrangement is of.
Image-to-image leaves part of the original signal in the latent. DDIM inversion removes it: the section is run backwards through the sampler for \(50\) steps under a null condition, arriving at a latent with standard deviation \(0.918\) and mean \(+0.020\) — statistically indistinguishable from the Gaussian noise the model was trained to denoise. As an image, the section is gone.
That single noise tensor was then resampled forward under three conditions: a satellite map of farmland, a cross-section of a meteorite, and abstract expressionist painting. Each returns a coherent image of the thing named. Farmland, mineral and paint from one array, differing only in the text supplied during the forward pass.
The six largest SAM pieces were then refilled, in order of area, with unrelated tissues and objects:
| piece | area (% of field) | filled with |
| \(0\) | \(219\,502\) (\(83.7\%\)) | dense muscle fibre |
| \(1\) | \(110\,340\) (\(42.1\%\)) | cartilage matrix |
| \(2\) | \(27\,793\) (\(10.6\%\)) | bone trabecula |
| \(3\) | \(18\,359\) (\(7.0\%\)) | adipose tissue |
| \(4\) | \(12\,874\) (\(4.9\%\)) | fern leaf |
| \(5\) | \(1\,554\) (\(0.6\%\)) | circuit board |
Because the pieces overlap, each fill partly overwrites the previous one, and the final image depends on the order in which they are applied. The result is a single field containing muscle, cartilage, bone, fat, a fern and a circuit board, with the boundaries of the original colonic glands intact.
The manipulations of §499 and §585 degrade. Change the binning lattice on a set of electron counts and the micrograph becomes unreadable; permute the weights of a language model and it emits Abbreviations where it emitted Paris. The failure announces itself.
Here nothing degrades. Every output is sharp, plausible and free of artefact. A reader shown the coral reef has no signal that it came from a colon biopsy, and a reader shown the section has no signal that eight equally well-formed alternatives exist. The intervention leaves no trace in the output, because producing a well-formed image is what the system does.
The two regimes also differ in what it costs to obtain the alternative. Reaching a different micrograph required rewriting the binning lattice or the algebra of summation. Reaching a different tissue requires changing five words of English. Moving up a processing chain, the freedom increases while the record of its exercise disappears.