├── .gitignore ├── README.md ├── code ├── __pycache__ │ ├── attacks.cpython-38.pyc │ ├── clip_similarity.cpython-38.pyc │ └── utils.cpython-38.pyc ├── attacks.py ├── clip_similarity.py ├── diff_mist.py ├── eval.py ├── eval_gen.py ├── inpaint.py ├── ldm │ ├── models │ │ ├── autoencoder.py │ │ └── diffusion │ │ │ ├── __init__.py │ │ │ ├── ddim.py │ │ │ └── ddpmAttack.py │ ├── modules │ │ ├── attention.py │ │ ├── diffusionmodules │ │ │ ├── __init__.py │ │ │ ├── model.py │ │ │ ├── openaimodel.py │ │ │ └── util.py │ │ ├── distributions │ │ │ ├── __init__.py │ │ │ └── distributions.py │ │ ├── ema.py │ │ ├── encoders │ │ │ ├── __init__.py │ │ │ └── modules.py │ │ ├── image_degradation │ │ │ ├── __init__.py │ │ │ ├── bsrgan.py │ │ │ ├── bsrgan_light.py │ │ │ ├── utils │ │ │ │ └── test.png │ │ │ └── utils_image.py │ │ ├── losses │ │ │ ├── __init__.py │ │ │ ├── contperceptual.py │ │ │ └── vqperceptual.py │ │ └── x_transformer.py │ └── util.py ├── test_bench.py └── utils.py ├── configs ├── attack │ └── base.yaml └── stable-diffusion │ └── v1-inference-attack.yaml ├── env.yml ├── out ├── advdm_eps16_steps100_gmode+ │ └── to_protect │ │ ├── suzume_attacked.png │ │ ├── suzume_multistep.png │ │ └── suzume_onestep.png ├── mist_eps16_steps100_gmode+ │ └── to_protect │ │ ├── suzume_attacked.png │ │ ├── suzume_multistep.png │ │ └── suzume_onestep.png ├── sdsT5_eps16_steps100_gmode- │ └── to_protect │ │ ├── suzume_attacked.png │ │ ├── suzume_multistep.png │ │ └── suzume_onestep.png └── sds_eps16_steps100_gmode- │ └── to_protect │ ├── suzume_attacked.png │ ├── suzume_multistep.png │ └── suzume_onestep.png └── test_images ├── media └── teaser.png ├── target └── MIST.png └── to_protect └── suzume.png /.gitignore: -------------------------------------------------------------------------------- 1 | ckpt/ 2 | outputs/ 3 | hub/ 4 | 5 | __pycache__ 6 | *.py[cod] 7 | *.sw[pon] 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/README.md -------------------------------------------------------------------------------- /code/__pycache__/attacks.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/__pycache__/attacks.cpython-38.pyc -------------------------------------------------------------------------------- /code/__pycache__/clip_similarity.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/__pycache__/clip_similarity.cpython-38.pyc -------------------------------------------------------------------------------- /code/__pycache__/utils.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/__pycache__/utils.cpython-38.pyc -------------------------------------------------------------------------------- /code/attacks.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/attacks.py -------------------------------------------------------------------------------- /code/clip_similarity.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/clip_similarity.py -------------------------------------------------------------------------------- /code/diff_mist.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/diff_mist.py -------------------------------------------------------------------------------- /code/eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/eval.py -------------------------------------------------------------------------------- /code/eval_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/eval_gen.py -------------------------------------------------------------------------------- /code/inpaint.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/inpaint.py -------------------------------------------------------------------------------- /code/ldm/models/autoencoder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/models/autoencoder.py -------------------------------------------------------------------------------- /code/ldm/models/diffusion/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/ldm/models/diffusion/ddim.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/models/diffusion/ddim.py -------------------------------------------------------------------------------- /code/ldm/models/diffusion/ddpmAttack.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/models/diffusion/ddpmAttack.py -------------------------------------------------------------------------------- /code/ldm/modules/attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/attention.py -------------------------------------------------------------------------------- /code/ldm/modules/diffusionmodules/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/ldm/modules/diffusionmodules/model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/diffusionmodules/model.py -------------------------------------------------------------------------------- /code/ldm/modules/diffusionmodules/openaimodel.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/diffusionmodules/openaimodel.py -------------------------------------------------------------------------------- /code/ldm/modules/diffusionmodules/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/diffusionmodules/util.py -------------------------------------------------------------------------------- /code/ldm/modules/distributions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/ldm/modules/distributions/distributions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/distributions/distributions.py -------------------------------------------------------------------------------- /code/ldm/modules/ema.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/ema.py -------------------------------------------------------------------------------- /code/ldm/modules/encoders/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/ldm/modules/encoders/modules.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/encoders/modules.py -------------------------------------------------------------------------------- /code/ldm/modules/image_degradation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/image_degradation/__init__.py -------------------------------------------------------------------------------- /code/ldm/modules/image_degradation/bsrgan.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/image_degradation/bsrgan.py -------------------------------------------------------------------------------- /code/ldm/modules/image_degradation/bsrgan_light.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/image_degradation/bsrgan_light.py -------------------------------------------------------------------------------- /code/ldm/modules/image_degradation/utils/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/image_degradation/utils/test.png -------------------------------------------------------------------------------- /code/ldm/modules/image_degradation/utils_image.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/image_degradation/utils_image.py -------------------------------------------------------------------------------- /code/ldm/modules/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from ldm.modules.losses.contperceptual import LPIPSWithDiscriminator -------------------------------------------------------------------------------- /code/ldm/modules/losses/contperceptual.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/losses/contperceptual.py -------------------------------------------------------------------------------- /code/ldm/modules/losses/vqperceptual.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/losses/vqperceptual.py -------------------------------------------------------------------------------- /code/ldm/modules/x_transformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/modules/x_transformer.py -------------------------------------------------------------------------------- /code/ldm/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/ldm/util.py -------------------------------------------------------------------------------- /code/test_bench.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/test_bench.py -------------------------------------------------------------------------------- /code/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/code/utils.py -------------------------------------------------------------------------------- /configs/attack/base.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/configs/attack/base.yaml -------------------------------------------------------------------------------- /configs/stable-diffusion/v1-inference-attack.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/configs/stable-diffusion/v1-inference-attack.yaml -------------------------------------------------------------------------------- /env.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/env.yml -------------------------------------------------------------------------------- /out/advdm_eps16_steps100_gmode+/to_protect/suzume_attacked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/advdm_eps16_steps100_gmode+/to_protect/suzume_attacked.png -------------------------------------------------------------------------------- /out/advdm_eps16_steps100_gmode+/to_protect/suzume_multistep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/advdm_eps16_steps100_gmode+/to_protect/suzume_multistep.png -------------------------------------------------------------------------------- /out/advdm_eps16_steps100_gmode+/to_protect/suzume_onestep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/advdm_eps16_steps100_gmode+/to_protect/suzume_onestep.png -------------------------------------------------------------------------------- /out/mist_eps16_steps100_gmode+/to_protect/suzume_attacked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/mist_eps16_steps100_gmode+/to_protect/suzume_attacked.png -------------------------------------------------------------------------------- /out/mist_eps16_steps100_gmode+/to_protect/suzume_multistep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/mist_eps16_steps100_gmode+/to_protect/suzume_multistep.png -------------------------------------------------------------------------------- /out/mist_eps16_steps100_gmode+/to_protect/suzume_onestep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/mist_eps16_steps100_gmode+/to_protect/suzume_onestep.png -------------------------------------------------------------------------------- /out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_attacked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_attacked.png -------------------------------------------------------------------------------- /out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_multistep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_multistep.png -------------------------------------------------------------------------------- /out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_onestep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sdsT5_eps16_steps100_gmode-/to_protect/suzume_onestep.png -------------------------------------------------------------------------------- /out/sds_eps16_steps100_gmode-/to_protect/suzume_attacked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sds_eps16_steps100_gmode-/to_protect/suzume_attacked.png -------------------------------------------------------------------------------- /out/sds_eps16_steps100_gmode-/to_protect/suzume_multistep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sds_eps16_steps100_gmode-/to_protect/suzume_multistep.png -------------------------------------------------------------------------------- /out/sds_eps16_steps100_gmode-/to_protect/suzume_onestep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/out/sds_eps16_steps100_gmode-/to_protect/suzume_onestep.png -------------------------------------------------------------------------------- /test_images/media/teaser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/test_images/media/teaser.png -------------------------------------------------------------------------------- /test_images/target/MIST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/test_images/target/MIST.png -------------------------------------------------------------------------------- /test_images/to_protect/suzume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavihart/Diff-Protect/HEAD/test_images/to_protect/suzume.png --------------------------------------------------------------------------------