{"id":13563100,"url":"https://github.com/openai/consistencydecoder","last_synced_at":"2025-04-08T00:37:11.928Z","repository":{"id":205838002,"uuid":"713405092","full_name":"openai/consistencydecoder","owner":"openai","description":"Consistency Distilled Diff VAE","archived":false,"fork":false,"pushed_at":"2023-11-07T11:21:38.000Z","size":791,"stargazers_count":2169,"open_issues_count":19,"forks_count":76,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-03-31T23:34:00.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openai.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-02T13:06:36.000Z","updated_at":"2025-03-28T09:25:42.000Z","dependencies_parsed_at":"2024-08-01T13:19:01.123Z","dependency_job_id":"f932d5d6-37e4-4f5b-95bf-1cf7ce952741","html_url":"https://github.com/openai/consistencydecoder","commit_stats":null,"previous_names":["openai/consistencydecoder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fconsistencydecoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fconsistencydecoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fconsistencydecoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fconsistencydecoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openai","download_url":"https://codeload.github.com/openai/consistencydecoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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-08-01T13:01:15.169Z","updated_at":"2025-04-08T00:37:11.908Z","avatar_url":"https://github.com/openai.png","language":"Python","funding_links":[],"categories":["Python","Repos"],"sub_categories":[],"readme":"# Consistency Decoder\n\n[[DALL·E 3]](https://openai.com/dall-e-3)\n[[Improving Image Generation with Better Captions]](https://cdn.openai.com/papers/dall-e-3.pdf)\n[[Consistency Models]](https://arxiv.org/abs/2303.01469)\n\nImproved decoding for stable diffusion vaes.\n\n## Installation\n\n```\n$ pip install git+https://github.com/openai/consistencydecoder.git\n```\n\n## Usage\n\n```python\nimport torch\nfrom diffusers import StableDiffusionPipeline\nfrom consistencydecoder import ConsistencyDecoder, save_image, load_image\n\n# encode with stable diffusion vae\npipe = StableDiffusionPipeline.from_pretrained(\n    \"runwayml/stable-diffusion-v1-5\", torch_dtype=torch.float16, device=\"cuda:0\"\n)\npipe.vae.cuda()\ndecoder_consistency = ConsistencyDecoder(device=\"cuda:0\") # Model size: 2.49 GB\n\nimage = load_image(\"assets/gt1.png\", size=(256, 256), center_crop=True)\nlatent = pipe.vae.encode(image.half().cuda()).latent_dist.mean\n\n# decode with gan\nsample_gan = pipe.vae.decode(latent).sample.detach()\nsave_image(sample_gan, \"gan.png\")\n\n# decode with vae\nsample_consistency = decoder_consistency(latent)\nsave_image(sample_consistency, \"con.png\")\n```\n\n## Examples\n Original Image | GAN Decoder | Consistency Decoder |\n:---:|:---:|:---:|\n![Original Image](assets/gt1.png) | ![GAN Image](assets/gan1.png) | ![VAE Image](assets/con1.png) |\n![Original Image](assets/gt2.png) | ![GAN Image](assets/gan2.png) | ![VAE Image](assets/con2.png) |\n![Original Image](assets/gt3.png) | ![GAN Image](assets/gan3.png) | ![VAE Image](assets/con3.png) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenai%2Fconsistencydecoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenai%2Fconsistencydecoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenai%2Fconsistencydecoder/lists"}