{"id":14958093,"url":"https://github.com/yinboc/infd","last_synced_at":"2025-10-24T14:30:45.725Z","repository":{"id":254767330,"uuid":"847478813","full_name":"yinboc/infd","owner":"yinboc","description":"Image Neural Field Diffusion Models, CVPR 2024 (Highlight)","archived":false,"fork":false,"pushed_at":"2024-08-25T23:49:48.000Z","size":289,"stargazers_count":37,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-27T20:03:30.932Z","etag":null,"topics":["diffusion-models","machine-learning","neural-fields","pytorch"],"latest_commit_sha":null,"homepage":"https://yinboc.github.io/infd/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yinboc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T23:36:56.000Z","updated_at":"2024-09-26T13:46:37.000Z","dependencies_parsed_at":"2024-08-26T01:23:38.997Z","dependency_job_id":"efaa7997-183b-464f-8bfd-cee5d1af33f0","html_url":"https://github.com/yinboc/infd","commit_stats":null,"previous_names":["yinboc/infd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Finfd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Finfd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Finfd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Finfd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinboc","download_url":"https://codeload.github.com/yinboc/infd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868597,"owners_count":16555871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion-models","machine-learning","neural-fields","pytorch"],"created_at":"2024-09-24T13:16:13.365Z","updated_at":"2025-10-24T14:30:44.790Z","avatar_url":"https://github.com/yinboc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Neural Field Diffusion Models\n\n![infd](https://github.com/user-attachments/assets/e8296750-6ec0-4917-8eb5-7dedd6c85dbb)\n\nOfficial implementation of the paper:\n\n[**Image Neural Field Diffusion Models**](https://arxiv.org/abs/2406.07480)\n\u003cbr\u003e\nYinbo Chen, Oliver Wang, Richard Zhang, Eli Shechtman, Xiaolong Wang, Michael Gharbi\n\u003cbr\u003e\nCVPR 2024 (Highlight)\n\nContact yinboc96@gmail.com for any issues about the code.\n\n## Environment\n```\nconda create -n infd python=3.8 -y\nconda activate infd\npip install -r requirements.txt\n```\n\n## Training\n\nBelow shows an example for training on FFHQ-1024 with 8 GPUs.\n\nDownload the FFHQ dataset ([images1024x1024.zip](https://drive.google.com/drive/folders/1WocxvZ4GEZ1DI8dOz30aSj2zT6pkATYS)). Unzip it and put the image folder as `load/ffhq/ffhq_1024`.\n\nTo visualize with wandb, complete information in `wandb.yaml` and append `-w` in running commands.\n\nTo train for the FFHQ-6K-Mix setting, append `-mix6000` to the yaml config names. \n\n### 1. Autoencoding stage\n```\nCUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 torchrun --standalone --nproc-per-node=8 run.py --cfg cfgs/ae_ffhq.yaml\n```\n\n### 2. Latent diffusion stage\n\nFirst resize the images for faster loading:\n```\npython resize_images.py --input load/ffhq/ffhq_1024 --output load/ffhq/ffhq_lanczos256\n```\n\nThen run:\n```\nCUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 torchrun --standalone --nproc-per-node=8 run.py --cfg cfgs/dm_ffhq.yaml\n```\n\n### Custom datasets\n\nTo train on custom datasets, use `ae_custom.yaml`, `dm_custom.yaml` as cfg and replace root_path in configs with path to the image folder.\n\n### Pretrained models\n\nModel|Download|pFID 256/1K|pFID 512/1K|pFID 1K/1K\n:-:|:-:|:-:|:-:|:-:\nFFHQ|[Google Drive](https://drive.google.com/file/d/1qhLZ8FOFDdrxgJCJvCDyy2IVIquiI9vx/view?usp=sharing)|7.91|6.73|5.71\nFFHQ 6K-Mix|[Google Drive](https://drive.google.com/file/d/1HbWgltZ7kcuo_S9fjPCOALDv8DBkuM6F/view?usp=sharing)|10.99|7.52|6.80\n\n## Evaluation\n\n### 1. Generate samples\n\nCan use a single or multiple GPUs. For example, with 2 GPUs:\n```\nCUDA_VISIBLE_DEVICES=0,1 python gen_samples.py --model save/dm_ffhq/last-model.pth --n-samples 50000 --batch-size 32 -o save/gen_samples --output-sizes 1024\n```\n\nBy default it uses the sampler defined in the model (200 DDIM steps, eta=1, following LDM).\n\n### 2. Evaluate patch FID\n\n```\nCUDA_VISIBLE_DEVICES=0 python eval_pfid.py --input1 load/ffhq/ffhq_1024 --input2 save/gen_samples/1024\n```\n\n## Citation\n```\n@inproceedings{chen2024image,\n  title={Image Neural Field Diffusion Models},\n  author={Chen, Yinbo and Wang, Oliver and Zhang, Richard and Shechtman, Eli and Wang, Xiaolong and Gharbi, Michael},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\n  pages={8007--8017},\n  year={2024}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinboc%2Finfd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinboc%2Finfd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinboc%2Finfd/lists"}