Skip to main content
. 2026 Oct 8;26(19):6351. doi: 10.3390/s26196351
Algorithm 1 Fine-tuning-free inference process of SLAID
  • Require: 

    Frozen AnyDoor model Dθ, DDIM sampler, reference image Ir, reference mask Mr, target image It, target mask Mt

  • Ensure: 

    Synthetic elongated fabric defect image I^

  •   1:

    Estimate defect geometry from Mr.

  •   2:

    Build shape-aware reference representations R using SSRM.

  •   3:

    Extract adaptive high-frequency guidance H using AHFG.

  •   4:

    Compose target control hint Ct from It, Mt, and H.

  •   5:

    Encode reference representations into conditions cr.

  •   6:

    Encode target crop into latent zt0 and construct anchor mask Manc.

  •   7:

    Initialize DDIM latent xT with target-domain anchoring.

  •   8:

    for τ=T to 1 do

  •   9:

          Predict noise ϵθ(xτ,Ct,cr) with the frozen AnyDoor model.

  • 10:

          Apply shape-aware detail guidance from R.

  • 11:

          Perform one DDIM denoising step to obtain xτ−1.

  • 12:

          Anchor non-edited regions in latent space using TLA.

  • 13:

    end for

  • 14:

    Decode x0 and blend the generated patch back into It.

  • 15:

    return I^.