{"id":13487846,"url":"https://github.com/salesforce/edict","last_synced_at":"2025-05-16T15:05:59.820Z","repository":{"id":66001671,"uuid":"575648170","full_name":"salesforce/EDICT","owner":"salesforce","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-27T13:38:47.000Z","size":94913,"stargazers_count":307,"open_issues_count":7,"forks_count":23,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-03T19:11:54.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/salesforce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-08T01:38:37.000Z","updated_at":"2025-03-31T10:50:46.000Z","dependencies_parsed_at":"2025-02-27T15:14:52.998Z","dependency_job_id":null,"html_url":"https://github.com/salesforce/EDICT","commit_stats":{"total_commits":6,"total_committers":3,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"6d7044423b8263517ac77e7725ccaf3abf678ef7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2FEDICT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2FEDICT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2FEDICT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2FEDICT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salesforce","download_url":"https://codeload.github.com/salesforce/EDICT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573255,"owners_count":21126793,"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":[],"created_at":"2024-07-31T18:01:05.065Z","updated_at":"2025-04-12T13:29:35.278Z","avatar_url":"https://github.com/salesforce.png","language":"Jupyter Notebook","readme":"# Official Implementation of EDICT: Exact Diffusion Inversion via Coupled Transformations\n\n[Arxiv](https://arxiv.org/abs/2211.12446)\n\nThe original framework for this code is based off of Github user bloc97's [implementation of Prompt-to-Prompt](https://github.com/bloc97/CrossAttentionControl). \n\n# What is EDICT?\n\nEDICT (Exact Diffusion Inversion via Coupled Transformations) is an algorithm that closely mirrors a typical generative diffusion process but in an invertible fashion. We achieve this by tracking a *pair* of intermediate representations instead of just one. This exact invertibility enables edits that remain extremely faithful to the original image. Check out our [paper](https://arxiv.org/abs/2211.12446) for more details and don't hesitate to reach out with questions!\n\n\n# Setup\n\n## HF Auth token\n\nPaste a copy of a suitable [HF Auth Token](https://huggingface.co/docs/hub/security-tokens) into [hf_auth](hf_auth) with no new line (to be read by the following code in `edict_functions.py`)\n```\nwith open('hf_auth', 'r') as f:\n    auth_token = f.readlines()[0].strip()\n    \n```\n\nExample file at `./hf_auth`\n```\nabc123abc123\n```\n\n## Environment\n\nRun  `conda env create -f environment.yaml`, activate that conda env (`conda activate edict`). Run jupyter with that conda env active\n\n# Experimentation\n\nCheck out [this notebook](EDICT.ipynb) for examples of how to use EDICT; including edits on randomly selected in-the-wild imagery ([alternative to render in browser](EDICT_no_images.ipynb)).\n\n# Example Results\n\n## Changing Dog Breeds\n\n![Dogs](figs/edits_dogs.png)\n\n## Miscellaneous\n\n\n![Some edits](figs/edits_1.png)\n\n![Some more edits](figs/edits_2.png)\n\n# Other Files\n\n[edict_functions.py](edict_functions.py) has the core functionality of EDICT. [my_diffusers](my_diffusers) is a very slightly changed version of the [HF Diffusers repo](https://github.com/huggingface/diffusers) to work in double precision and avoid floating-point errors in our inversion/reconstruction experiments. EDICT editing also works at lower precisions, but to allow all experiments in a unified setting we present the double-precision floating point version of the code.\n\n# Citation\n\nIf you find our work useful in your research, please cite:\n\n```\n@article{wallace2022edict,\n  title={EDICT: Exact Diffusion Inversion via Coupled Transformations},\n  author={Wallace, Bram and Gokul, Akash and Naik, Nikhil},\n  journal={arXiv preprint arXiv:2211.12446},\n  year={2022}\n}\n```\n\n# License\n\nOur code is BSD-3 licensed. See LICENSE.txt for details.\n\n","funding_links":[],"categories":["Diffusion Models Inversion"],"sub_categories":["Train-Free"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fedict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesforce%2Fedict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fedict/lists"}