Views
No views yet
ffhq-diffusers/ directory contains the FFHQ diffusion weights from the original paper (https://arxiv.org/abs/2112.10752), converted to match the Hugging Face Diffusers library format.1import os
2import torch
3
4from anonymization.diffusion import DiffusionModel
5from anonymization.controlnet import ControlNet
6from config.config_main import config
7
8device = "cuda"
9
10diffusion_model = DiffusionModel(
11 name="ffhq",
12 torch_device=device,
13 models_root=config.models_root,
14 weights_root=config.weights_root,
15)
16
17controlnet = ControlNet(
18 model_config=diffusion_model.unet.config,
19 model_ckpt="ffhq-diffusers",
20 hint_channels=3,
21 down_sample_factor=4,
22 device=device,
23)
24
25state_dict = torch.load("controlnet_epoch_15.pth", map_location=device)
26controlnet.load_state_dict(state_dict)
27controlnet.eval()1controlnet_epoch_15.pth
2controlnet_config.json
3ffhq-diffusers/
4keys/
5|-- keys_CelebA_HQ.pt
6|-- sub_keys_diversity_0.pt
7|-- sub_keys_diversity_1.pt
8|-- ...
9`-- sub_keys_diversity_9.pt
10README.md1@article{diffusion_signflip_anonymization,
2 title = {Secure and reversible face anonymization based on a diffusion model with face mask guidance},
3 author = {Pol Labarbarie and Vincent Itier and William Puech},
4 journal = {},
5 year = {2026}
6}