{"id":19635941,"url":"https://github.com/talkuhulk/ddim_scheduler_cpp","last_synced_at":"2025-04-28T14:14:36.038Z","repository":{"id":239029463,"uuid":"798308510","full_name":"TalkUHulk/ddim_scheduler_cpp","owner":"TalkUHulk","description":"This project provides a cross-platform C++ ddim scheduler library that is consistent with the Diffusers:DDIMScheduler interface. ","archived":false,"fork":false,"pushed_at":"2024-06-06T09:48:38.000Z","size":2321,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T14:14:29.504Z","etag":null,"topics":["cpp","ddim"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TalkUHulk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-09T14:17:05.000Z","updated_at":"2025-03-23T07:22:09.000Z","dependencies_parsed_at":"2024-05-09T15:49:22.013Z","dependency_job_id":"f0892cba-5982-44cb-9be0-c04df7c3a963","html_url":"https://github.com/TalkUHulk/ddim_scheduler_cpp","commit_stats":null,"previous_names":["talkuhulk/ddim_scheduler_cpp"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkUHulk%2Fddim_scheduler_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkUHulk%2Fddim_scheduler_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkUHulk%2Fddim_scheduler_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalkUHulk%2Fddim_scheduler_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TalkUHulk","download_url":"https://codeload.github.com/TalkUHulk/ddim_scheduler_cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326851,"owners_count":21571636,"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":["cpp","ddim"],"created_at":"2024-11-11T12:27:39.961Z","updated_at":"2025-04-28T14:14:36.016Z","avatar_url":"https://github.com/TalkUHulk.png","language":"C++","readme":"## ddim_scheduler_cpp\n\n\nThis project provides a cross-platform C++ ddim scheduler library that can be universally deployed. It is consistent with the [Diffusers:DDIMScheduler](https://huggingface.co/docs/diffusers/api/schedulers/ddim) interface. You can easily convert Python code to C++.\n\nddim_scheduler_cpp是一个C++版本的ddim-scheduler库。矩阵运算使用了Eigen库，所以理论上是支持各个平台的。ddim_scheduler_cpp提供了与[Diffusers:DDIMScheduler](https://huggingface.co/docs/diffusers/api/schedulers/ddim) 相同的接口，可以直接拿来替换python版本。\n\n\n### Getting Started\n\n#### build\n\n`mkdir build \u0026 cd build`\n\n`cmake .. -DDDIM_SHARED_LIB=ON/OFF -DCMAKE_INSTALL_PREFIX=\"path you wanna install\"`\n\n`make -j8`\n\n\nAfter install\n\n```asm\ninstall/\n├── ddim_scheduler_cpp\n    └── ddimscheduler.hpp\n└── lib   \n    └── libddim_scheduler_cpp.a or libddim_scheduler_cpp.so\n```\n\n\n\n#### Example Code\n\nYou can get [scheduler_config.json](https://huggingface.co/runwayml/stable-diffusion-inpainting/blob/main/scheduler/scheduler_config.json) from huggingface. \n\n```c++\n// init from json\nauto scheduler = DDIMScheduler(\"scheduler_config.json\");\n\n// set num_inference_steps\nscheduler.set_timesteps(10);\n\n// get timesteps\nstd::vector\u003cint\u003e timesteps;\nscheduler.get_timesteps(timesteps);\n\n// random init for example\nstd::vector\u003cfloat\u003e sample(1 * 4 * 64 * 64);\nstd::vector\u003cfloat\u003e model_output(1 * 4 * 64 * 64);\n\nfor(int i = 0; i \u003c 4 * 64 * 64; i++){\n    sample[i] = distribution(generator);\n    model_output[i] = distribution(generator);\n}\n\n// step\nstd::vector\u003cfloat\u003e pred_sample;\nfor(auto t: timesteps){\n    scheduler.step(model_output, {1, 4, 3, 3}, sample, {1, 4, 3, 3}, pred_sample, t);\n}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalkuhulk%2Fddim_scheduler_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalkuhulk%2Fddim_scheduler_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalkuhulk%2Fddim_scheduler_cpp/lists"}