{"id":19815955,"url":"https://github.com/replicate/latent-consistency-model","last_synced_at":"2025-05-01T10:31:56.792Z","repository":{"id":203792930,"uuid":"709253062","full_name":"replicate/latent-consistency-model","owner":"replicate","description":"Run Latent Consistency Models on your Mac","archived":false,"fork":false,"pushed_at":"2023-11-10T22:28:49.000Z","size":45,"stargazers_count":198,"open_issues_count":9,"forks_count":13,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-06T12:45:55.859Z","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/replicate.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}},"created_at":"2023-10-24T10:45:42.000Z","updated_at":"2025-04-03T14:34:40.000Z","dependencies_parsed_at":"2023-11-01T12:26:14.128Z","dependency_job_id":null,"html_url":"https://github.com/replicate/latent-consistency-model","commit_stats":null,"previous_names":["replicate/latent-consistency-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Flatent-consistency-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Flatent-consistency-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Flatent-consistency-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Flatent-consistency-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/latent-consistency-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251860034,"owners_count":21655665,"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-11-12T10:07:50.881Z","updated_at":"2025-05-01T10:31:56.511Z","avatar_url":"https://github.com/replicate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Run latent consistency models on your Mac\n\nLatent consistency models (LCMs) are based on Stable Diffusion, but they can generate images much faster, needing only 4 to 8 steps for a good image (compared to 25 to 50 steps). [Simian Luo et al](https://arxiv.org/abs/2310.04378) released the first Stable Diffusion distilled model. It’s distilled from the Dreamshaper fine-tune by incorporating classifier-free guidance into the model’s input.\n\nYou can [run Latent Consistency Models in the cloud on Replicate](https://replicate.com/luosiallen/latent-consistency-model), but it's also possible to run it locally.\n\n## Prerequisites\n\nYou’ll need:\n\n- a Mac with an M1 or M2 chip\n- 16GB RAM or more\n- macOS 13.0 or higher\n- Python 3.10 or above\n\n## Install\n\nRun this to clone the repo:\n\n    git clone https://github.com/replicate/latent-consistency-model.git\n    cd latent-consistency-model\n\nSet up a virtualenv to install the dependencies:\n\n    python3 -m pip install virtualenv\n    python3 -m virtualenv venv\n\nActivate the virtualenv:\n\n    source venv/bin/activate\n\n(You'll need to run this command again any time you want to run the script.)\n\nThen, install the dependencies:\n\n    pip install -r requirements.txt\n\n## Run\n\nThe script will automatically download the [`SimianLuo/LCM_Dreamshaper_v7`](https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7) (3.44 GB) and [safety checker](https://huggingface.co/CompVis/stable-diffusion-safety-checker) (1.22 GB) models from HuggingFace.\n\n```sh\npython main.py \\\n  \"a beautiful apple floating in outer space, like a planet\" \\\n  --steps 4 --width 512 --height 512\n```\n\nYou’ll see an output like this:\n\n```sh\nOutput image saved to: output/out-20231026-144506.png\nUsing seed: 48404\n100%|███████████████████████████| 4/4 [00:00\u003c00:00,  5.54it/s]\n```\n\n## Options\n\n| Parameter     | Type  | Default | Description                                                   |\n|---------------|-------|---------|---------------------------------------------------------------|\n| prompt        | str   | N/A     | A text string for image generation.                           |\n| --width       | int   | 512     | The width of the generated image.                             |\n| --height      | int   | 512     | The height of the generated image.                            |\n| --steps       | int   | 8       | The number of inference steps.                                |\n| --seed        | int   | None    | Seed for random number generation.                            |\n| --continuous  | flag  | False   | Enable continuous generation.                                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Flatent-consistency-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Flatent-consistency-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Flatent-consistency-model/lists"}