Fine-Tuning Stable Diffusion on Small Data for Localized Garden Photo Inpainting

Fine-tuning only the U-Net on 433 landscaping images enables boundary-faithful localized garden editing.
An arXiv study tackles two pain points of general-purpose diffusion models for garden makeovers on real residential photos—poor understanding of landscaping terms and unintended changes outside the region—by freezing Stable Diffusion 2's autoencoder and text encoder, fine-tuning only the U-Net on 433 annotated landscaping images, and using mask-guided SDEdit-style latent editing to repaint only user-painted areas. Evaluated with no-reference metrics, 46 edits yield median out-of-region PSNR of 56.3 dB, mean SSIM of 0.998, and a seam ratio of 0.94 versus 0.96; failures such as ignored negative prompts and overly literal prompt rendering are candidly reported.
Why Can't General-Purpose Diffusion Models Handle Garden Makeovers?
Generating a beautiful outdoor scene with Stable Diffusion isn't hard. The hard part is doing localized edits on real residential photos: the model must understand landscaping jargon like "decking," "stone pathways," "hedging," and "raised planters," while strictly preserving everything outside the edited region. General-purpose models usually fail on both fronts: they either misinterpret landscaping terms or quietly alter things they shouldn't touch during inpainting.

A study from arXiv proposes a simple recipe to solve both problems at once: briefly fine-tune Stable Diffusion 2's U-Net on 433 annotated landscaping images while freezing the autoencoder and text encoder, then use the resulting checkpoint for mask-guided latent-space editing—regenerating only the ground area the user has painted over.
Method: Freeze Most of It, Tune Only the U-Net
The researchers' approach is notably restrained: don't touch the autoencoder (to preserve reconstruction quality), don't touch the text encoder (to retain existing language understanding), and fine-tune only the U-Net to inject landscaping domain knowledge. 433 images is an extremely small dataset for diffusion model fine-tuning, but what the authors set out to verify is precisely whether small data is sufficient.
At inference, they use SDEdit-style editing: the user draws a mask over the region to be transformed, the model regenerates within that region according to the text prompt, and pixels outside the region remain unchanged. Denoising strength controls the magnitude of change—standard practice for latent-space editing.
Division of labor among the U-Net, autoencoder, and text encoder in a latent diffusion model
Stable Diffusion is a latent diffusion model whose inference pipeline chains together three core components. The autoencoder (VAE) handles bidirectional mapping between pixel space and latent space: the encoder compresses a 512×512 image into a 64×64 latent representation, and the decoder restores the denoised latent representation back to an image; the autoencoder's reconstruction fidelity therefore directly determines final image quality. The text encoder (CLIP's text tower) converts user prompts into the embedding vectors used for cross-attention, carrying the model's overall understanding of language. The U-Net is the denoising network itself, receiving the noisy latent representation, timestep embedding, and text embedding at each timestep and predicting the noise to be removed. Which parts to freeze and which to train during fine-tuning is essentially a trade-off: which component to inject new knowledge into, and which existing capabilities not to break.
SDEdit-style mask-guided editing
SDEdit (Stochastic Differential Editing) is a training-free, inversion-free editing method: first add Gaussian noise of a certain strength to the original image, then run reverse sampling from that noisy state at a relatively low denoising strength, so the output is structurally close to the original while following the text prompt in detail. The lower the denoising strength (i.e., the starting timestep), the subtler the change; the higher, the freer. Combining this process with a user-drawn binary mask yields mask-guided editing: "noise-add—denoise" runs only within the masked region, while pixels outside the mask are taken directly from the original image (or blended in latent space), guaranteeing at the mechanism level that unpainted regions remain pixel-for-pixel unchanged. The paper's "outside-region PSNR of 56.3 dB" comes precisely from this design, not from the model spontaneously learning restraint.
How to Prove It Works? An Evaluation Strategy Without Reference Metrics
Garden makeovers have no "ground truth," so the gap to a reference cannot be computed. The researchers therefore use no-reference measurements to check, across four dimensions, whether the pipeline behaves as intended.
Are pixels outside the region really untouched?
Across 46 edits on 10 residential photos, the median PSNR outside the edited region reached 56.3 dB, with a mean SSIM of 0.998. These two numbers indicate near pixel-for-pixel consistency outside the region—the most critical metric for the hard requirement of "preserving the original."
Interpreting PSNR and SSIM
PSNR (peak signal-to-noise ratio) measures the pixel-wise mean squared error between two images in decibels; higher values mean greater similarity. For 8-bit images, around 30 dB is typically "differences hard to discern with the naked eye," above 40 dB is considered high-quality reconstruction, and 56.3 dB means the error magnitude is extremely small, essentially pixel-for-pixel identical. SSIM (structural similarity) instead compares local windows along three dimensions—luminance, contrast, and structure—on a scale from 0 to 1, with values closer to 1 indicating greater structural consistency; 0.998 is already very close to identical. Using both together is deliberate: PSNR is sensitive to pixel-level deviations but insensitive to structural perception, while SSIM is closer to human structural perception; reporting both therefore supports the claim that "the outside region is unchanged" more comprehensively. Note that the high values of these two metrics here are largely an inevitable consequence of the masking mechanism, not independent proof of model capability.
Are the seams jarring?
Edge energy at the edit boundary is comparable to that of the original photo—a seam ratio of 0.94 versus 0.96—meaning the newly generated content does not create extra visual discontinuities at the boundary.
Edge energy and seam ratio
Edge energy measures the local gradient strength of an image: after applying edge detection (e.g., Sobel or Laplacian operators), the response magnitudes near the boundary are tallied. If newly generated content is inconsistent with the original photo in tone, lighting, or texture, an extra high-gradient "fault line" appears at the edit boundary, making edge energy noticeably higher than in the original. The seam ratio is the ratio of edge energy in the boundary region after editing to that in the corresponding region of the original; 0.94 versus 0.96 means the two are nearly on par, and the new content creates no extra visual discontinuity at the seam. This metric targets exactly the most typical artifact pattern in localized editing—techniques such as Poisson blending and soft mask feathering essentially all aim to push this ratio down.
Do random seeds produce diversity?
Different seeds yield markedly different layouts, showing that the model has not collapsed into fixed outputs and that users can try different seeds to pick a design.
Is the magnitude of change controllable?
The magnitude of change stays consistent with denoising strength, matching the expected behavior of SDEdit-style editing.
Failure Cases Deserve Attention Too
The paper doesn't dodge the problems and presents the failure modes observed. One is ignored negative prompts—the model does not exclude unwanted content according to the negation; another is overly literal rendering of prompt phrases, stiffly drawing descriptive words as depicted. Both failure types are common in text-to-image, but in localized editing they damage the experience more obviously, because users have clear expectations for the transformed region.
Implications for Practical Applications
The value of this work isn't in achieving high generative-quality scores but in validating a low-cost path: a few hundred domain images plus fine-tuning with most components frozen is enough for a general-purpose diffusion model to learn vocabulary for a specific scene and hold the boundary in localized editing. For scenarios like home renovation and landscape design that require "credible modifications to real photos," out-of-region fidelity and natural seams often matter more than stunning visuals.
Small data volume, evaluation relying on no-reference metrics, and failure cases that still exist—these are all limitations. But as a small-data case study, it offers a reproducible recipe and honest boundaries.
Note: The experimental setup and data in this article all come from the original paper's abstract; no external figures were introduced.
One-line Summary
Fine-tuning only the U-Net on 433 landscaping images enables boundary-faithful localized garden editing.
Paragraph Summary
An arXiv study addresses two pain points of general-purpose diffusion models for garden makeovers on real residential photos—insufficient understanding of landscaping terms and unintended changes to pixels outside the region—with a restrained approach: freeze Stable Diffusion 2's autoencoder and text encoder, fine-tune only the U-Net on 433 annotated landscaping images, then use mask-guided SDEdit-style latent-space editing to repaint only the user-painted region. Since there's no ground truth, evaluation uses no-reference metrics: across 46 edits, median out-of-region PSNR reaches 56.3 dB, mean SSIM is 0.998, and a seam ratio of 0.94 versus 0.96 indicates no obvious boundary discontinuity; different seeds produce markedly different layouts, and the magnitude of change varies with denoising strength. The paper also honestly presents failure cases such as ignored negative prompts and overly literal rendering of prompt phrases, and notes that small data and no-reference evaluation remain limitations.
Related articles

Jensen Huang Testifies Before Congress: Key Takeaways on Chip Export Controls
NVIDIA CEO Jensen Huang faces questioning from the U.S. House Foreign Affairs Committee on AI chip export controls, commercial interests, and national security.

Tencent WorkBuddy in Practice: Building an AI Automated Testing Workbench with SKILL Capabilities
Based on Bilibili creator Baili Yang's sharing, this article analyzes how Tencent WorkBuddy AI agent desktop workbench can be used for automated testing: the shift from AI-assisted to AI-led, the relationship among large models, agents, and SKILL capabilities, zero-configuration installation and permission control, and practical ideas for building a personal AI automated testing workbench.

Adding Authentication to Remix SaaS Apps: A Practical Guide to WorkOS AuthKit
Based on the official WorkOS AuthKit guide, this article covers the full approach to integrating authentication in Remix or React Router SaaS apps, including session management, protected routes, multi-tenant organizations, enterprise SSO, and SCIM sync, and analyzes its engineering value for SaaS teams.