juspice.stable_diff

Synthetic microscopy images with Stable Diffusion.

Wraps Hugging Face diffusers pipelines in StableDiff. Two modes are available, both using pre-trained weights without extra training:

  • img2img (is_masked=False): Stable Diffusion v1.5 (runwayml/stable-diffusion-v1-5) creates variations of an input image guided by a text prompt.

  • Inpainting (is_masked=True): Stable Diffusion XL inpainting (diffusers/stable-diffusion-xl-1.0-inpainting-0.1) redraws the masked region of the input image.

StableDiff.stadiff_generate_synthetic_frames() builds a short frame sequence in which the masked object gradually moves and changes size.