TheSolY/lr-tmi

Low Resource Attack on Stable Diffusion to extract Template Memorized Images.

1

stars

12

commits

Python

primary language

Jun 11, 2026

updated

README

Image Template Generation and Clique Search

This repository provides two scripts to support the paper's experiments:

  1. generate_image_templates.py: Generates images from template-style text prompts.
  2. clique_search.py: Performs a clique search with image segmentation.

Requirements

conda env create -f environment.yml\
conda activate lr-tmi

Reproduction Instructions

Step 1: Generate Synthetic Images

python generate_image_templates.py \
    -t "skg Shower Curtain" \
    -t "skg Round Beach Towel"

This will generate two sets of images in generated_images/, e.g.:

  • generated_images/skg_Shower_Curtain/
  • generated_images/skg_Round_Beach_Towel/

Alternatively, to generate images with Stable Diffusion V. 3.5 Medium:

python generate_image_templates.py \
    -t "skg Shower Curtain" \
    -t "skg Round Beach Towel"\
    --model_id "stabilityai/stable-diffusion-3.5-medium"

python clique_search.py \
    -p "generated_images/skg_Shower_Curtain" \
    -d ADE \
    -c curtain

This searches for image cliques among the generated "Shower Curtain" images with segmentation on ADE category curtain. The results will be saved to "./clique_results".


Notes

  • All outputs are saved in the working directory.
  • This setup is intended for quick verification of the proposed pipeline.

Contributors

TheSolY

12 commits

TheSolY/lr-tmi

Low Resource Attack on Stable Diffusion to extract Template Memorized Images.

1

stars

12

commits

Python

primary language

Jun 11, 2026

updated

README

Image Template Generation and Clique Search

This repository provides two scripts to support the paper's experiments:

  1. generate_image_templates.py: Generates images from template-style text prompts.
  2. clique_search.py: Performs a clique search with image segmentation.

Requirements

conda env create -f environment.yml\
conda activate lr-tmi

Reproduction Instructions

Step 1: Generate Synthetic Images

python generate_image_templates.py \
    -t "skg Shower Curtain" \
    -t "skg Round Beach Towel"

This will generate two sets of images in generated_images/, e.g.:

  • generated_images/skg_Shower_Curtain/
  • generated_images/skg_Round_Beach_Towel/

Alternatively, to generate images with Stable Diffusion V. 3.5 Medium:

python generate_image_templates.py \
    -t "skg Shower Curtain" \
    -t "skg Round Beach Towel"\
    --model_id "stabilityai/stable-diffusion-3.5-medium"

python clique_search.py \
    -p "generated_images/skg_Shower_Curtain" \
    -d ADE \
    -c curtain

This searches for image cliques among the generated "Shower Curtain" images with segmentation on ADE category curtain. The results will be saved to "./clique_results".


Notes

  • All outputs are saved in the working directory.
  • This setup is intended for quick verification of the proposed pipeline.

Contributors

TheSolY

12 commits

Languages

Python

75.6%

Jupyter Notebook

22.9%

Shell

1.5%