{"id":43543364,"url":"https://github.com/devsapp/fc-stable-diffuson","last_synced_at":"2026-02-03T18:38:10.468Z","repository":{"id":152558005,"uuid":"624804204","full_name":"devsapp/fc-stable-diffuson","owner":"devsapp","description":"部署stable-diffusion到阿里云函数计算","archived":false,"fork":false,"pushed_at":"2024-12-06T01:40:05.000Z","size":267572,"stargazers_count":88,"open_issues_count":8,"forks_count":41,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-12-06T02:29:08.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devsapp.png","metadata":{"files":{"readme":"readme-api.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":"2023-04-07T09:47:08.000Z","updated_at":"2024-09-03T14:43:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c8e9e05-94c0-43e7-a068-9699503710bd","html_url":"https://github.com/devsapp/fc-stable-diffuson","commit_stats":null,"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/devsapp/fc-stable-diffuson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Ffc-stable-diffuson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Ffc-stable-diffuson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Ffc-stable-diffuson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Ffc-stable-diffuson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsapp","download_url":"https://codeload.github.com/devsapp/fc-stable-diffuson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Ffc-stable-diffuson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29052649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-03T18:38:05.544Z","updated_at":"2026-02-03T18:38:10.462Z","avatar_url":"https://github.com/devsapp.png","language":"Dockerfile","readme":"\u003e 注：当前项目为 Serverless Devs\n\u003e 应用，由于应用中会存在需要初始化才可运行的变量（例如应用部署地区、服务名、函数名等等），所以**不推荐**直接 Clone 本仓库到本地进行部署或直接复制\n\u003e s.yaml 使用，**强烈推荐**通过 `s init` 的方法或应用中心进行初始化，详情可参考[部署 \u0026 体验](#部署--体验) 。\n\n# fc-stable-diffusion-api 帮助文档\n\n\u003cp align=\"center\" class=\"flex justify-center\"\u003e\n    \u003ca href=\"https://www.serverless-devs.com\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=fc-stable-diffusion-api\u0026type=packageType\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=fc-stable-diffusion-api\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=fc-stable-diffusion-api\u0026type=packageVersion\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=fc-stable-diffusion-api\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=fc-stable-diffusion-api\u0026type=packageDownload\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdescription\u003e\n\n使用serverless devs将stable-diffusion 的api服务部署到阿里云函数计算上，支持自定义模型，可以共享已有的stable-diffusion服务\n\n\u003c/description\u003e\n\n\u003ccodeUrl\u003e\n\n- [:smiley_cat: 代码](https://github.com/devsapp/fc-stable-diffuson)\n\n\u003c/codeUrl\u003e\n\u003cpreview\u003e\n\n\u003c/preview\u003e\n\n## 前期准备\n\n使用该项目，您需要有开通以下服务：\n\n\u003cservice\u003e\n\n| 服务      | 备注 |\n| ------- | -- |\n| 函数计算 FC |    |\n| 文件存储 NAS |    |\n\n\u003c/service\u003e\n\n推荐您拥有以下的产品权限 / 策略：\n\u003cauth\u003e\n\n\u003c/auth\u003e\n## 应用介绍文档\n### 应用详情\n本应用旨在帮助开发者实现将[stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 开源应用部署到阿里云函数计算，保留其api服务，并且提供动态管理模型插件等能力\n\u003cappdetail id=\"flushContent\"\u003e\n\u003c/appdetail\u003e\n\n## 使用文档\n### 本地部署方案\n\u003cdeploy\u003e\n\n  - 安装 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install)  开发者工具`npm install @serverless-devs/s -g`\n    ，并进行[授权信息配置](https://docs.serverless-devs.com/fc/config) ；\n  - 初始化项目：`s init fc-stable-diffusion-api -d fc-stable-diffusion-api`\n  - 进入项目，并进行项目部署：`cd fc-stable-diffusion-api \u0026\u0026 s deploy - y`\n本地部署成功后使用部分参考应用中心部署方案配置管理后台系列操作\n\u003c/deploy\u003e\n\n### 应用中心部署方案\n### ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683461638633-942efd24-2edf-41bd-8654-89f115e348ae.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=895\u0026id=u334249e9\u0026originHeight=1790\u0026originWidth=3548\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=2234309\u0026status=done\u0026style=none\u0026taskId=u76368d40-2f09-4f3b-a3e4-de7f5e8485b\u0026title=\u0026width=1774)\n通过模版创建应用-\u003e 人工智能选项卡-\u003e AI数字绘画stable-diffusion api服务-\u003e立即创建\n### 填写表单项\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683461803985-e41d7585-5290-415f-aaf6-272cfea79c5b.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=932\u0026id=u8bafe9d1\u0026originHeight=1864\u0026originWidth=3386\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1934288\u0026status=done\u0026style=none\u0026taskId=u02aec15c-b0cc-4c02-abc4-96700bc4faa\u0026title=\u0026width=1693)\n选择直接部署-\u003e 杭州/北京/上海/深圳地域 -\u003e 复制开发者准备好的容器镜像\n 杭州region: registry.cn-hangzhou.aliyuncs.com/serverlessdevshanxie/sd-auto-nas:apionly\n   北京region: registry.cn-beijing.aliyuncs.com/serverlessdevshanxie/sd-auto-nas:apionly\n   深圳region: registry.cn-shenzhen.aliyuncs.com/serverlessdevshanxie/sd-auto-nas:apionly\n   上海region: registry.cn-shanghai.aliyuncs.com/serverlessdevshanxie/sd-auto-nas:apionly \n点击创建并部署默认环境\n### 应用部署\n接下来什么都不需要操作，等待应用部署即可，约花费5-10分钟， 如果你是技术同学，可以展开看看我们提供的部署日志，观察部署过程\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683461882180-9c03225c-6083-48dc-9d41-c4d250a4078f.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=763\u0026id=u3eafadd6\u0026originHeight=1526\u0026originWidth=2974\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1679012\u0026status=done\u0026style=none\u0026taskId=u903b7e84-f059-4236-b21c-221e450f505\u0026title=\u0026width=1487)\n\n### 配置管理后台\n部署成功后得到两个域名\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462322986-6dd3cc6c-de40-4f0f-aa9f-a08781fcec4d.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=255\u0026id=ua83aae53\u0026originHeight=510\u0026originWidth=1648\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=340481\u0026status=done\u0026style=none\u0026taskId=ud1417aee-7314-4cfa-a4b6-83794124dae\u0026title=\u0026width=824)\n其中sd开头的是主服务\nadmin开头的是我们的管理后台，您可以选择直接访问sd服务，我们提前为您准备了默认的sd1.5基础模型，也可以通过管理后台添加更多的模型和扩展，登录管理后台以及上传模型教程如下\n\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462407669-d8321fe2-e5c3-4858-84be-e27fc51449fa.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=923\u0026id=uf26f0147\u0026originHeight=1846\u0026originWidth=3522\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=5431845\u0026status=done\u0026style=none\u0026taskId=u2ade747c-a250-4d08-82d4-af7043ff905\u0026title=\u0026width=1761)\n管理后台使用的是 可道云提供的 kod-box，对于你而言一路点点点，就可以\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462449802-e95a58af-2aef-4908-a047-4e0a24a85b97.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=620\u0026id=u5de0c684\u0026originHeight=1240\u0026originWidth=1698\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1362726\u0026status=done\u0026style=none\u0026taskId=u9b5f01bd-4296-408e-9bc7-5827c044b22\u0026title=\u0026width=849)\n等初始化好之后，设置自己的登录账号和密码\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462492174-aff0e298-c20a-42a2-8c26-7aceb3f89be2.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=825\u0026id=uec11eb95\u0026originHeight=1650\u0026originWidth=2722\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=3978912\u0026status=done\u0026style=none\u0026taskId=ubb7da915-9392-48de-b946-3ce287ffc41\u0026title=\u0026width=1361)\n之后进行登录\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462570237-b92cd673-b0a8-4990-a2b0-6000e3c52f33.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=604\u0026id=u0cee9d6b\u0026originHeight=1208\u0026originWidth=1158\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1292053\u0026status=done\u0026style=none\u0026taskId=uf04dc207-be0d-4fde-8218-0270a2fbf00\u0026title=\u0026width=579)\n登录后在路径输入 /mnt/auto/sd\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462657365-fbeffad5-959e-4146-93fc-7fc7870acba5.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=877\u0026id=u5bdf6be3\u0026originHeight=1754\u0026originWidth=3546\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1801931\u0026status=done\u0026style=none\u0026taskId=u9f5ca6e2-c5c5-4681-a2fe-a921b95de25\u0026title=\u0026width=1773)\n如果你熟悉sd-webui的目录的话，你可以看到对应的目录\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462697869-704c768f-8081-40de-b9f8-695947d510a9.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=722\u0026id=u3075dff9\u0026originHeight=1444\u0026originWidth=3472\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1676917\u0026status=done\u0026style=none\u0026taskId=ua4e68371-f843-439d-9049-bf2c8e8f6db\u0026title=\u0026width=1736)\n接下来我们打开/mnt/auto/sd/models/Stable-diffusion/ ,然后点击上传-\u003e离线下载\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683462759753-fcb5f1f7-12b8-44c9-9386-ebdf6d8ca78f.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=890\u0026id=ud0edb1b4\u0026originHeight=1780\u0026originWidth=3564\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1855469\u0026status=done\u0026style=none\u0026taskId=u990255b9-b49a-4a1e-833f-2399b066f98\u0026title=\u0026width=1782)\n\n\n你也可以输入已经外部网站的模型地址，或者您先上传到阿里云OSS，通过同地域的内网地址进行下载，除了下载，你也可以把本地的模型直接拖拽上传。\n因为模型较大，下载时间预计花费5-15分钟，可以休息等待一下（如果提升出错可以忽略）\n![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/13970/1683465959658-c672bd36-cde0-4d83-bef5-1e47f9c601ee.png#clientId=u03391672-5bf6-4\u0026from=paste\u0026height=795\u0026id=u65ee50e7\u0026originHeight=1590\u0026originWidth=3524\u0026originalType=binary\u0026ratio=2\u0026rotation=0\u0026showTitle=false\u0026size=1670748\u0026status=done\u0026style=none\u0026taskId=u1fa844fb-df6f-4672-982b-3f6d9406807\u0026title=\u0026width=1762)\n\n\n\n\n\n\u003cusedetail id=\"flushContent\"\u003e\n\n## 源码定制\n如果您觉得我们提供的镜像能力不能满足您的需求，您可以通过社区开发者开放的构建[镜像源码](https://github.com/ai-app-with-serverless/fc-stable-diffusion-image/tree/apionly)进行重新构建\n\n\n定制好自己的镜像之后可以替换上面流程中需要填写的镜像部分即可，注意对应好地域。\n\n\n### 常见问题\n\n#### 1. 冷启动时间较长如何优化？\n\n因为本身sd的模型较大，打包镜像后依然达到10G，函数计算拉起镜像冷启动时间会比较长，大概2-5分钟，我们提供了预加载界面，避免您长时间的白屏等待。\n\n#### 2.镜像加速\n\n为了提升冷启动时间，我们提供了镜像加速服务，请关注控制台上的镜像加速状态，只有在ready才真正可用。\n\n#### 3. 刚进去输入提示词构建偶尔会失败\n\n这个可能是因为模型本身还未加载，请注意查看左上角选择框里面包含模型内容，之后再操作。出图的时候会有一定的等待时间，这个是正常现象，耐心等待即可\n\n#### 4 资费消耗\n\nGPU本身对算力资源消耗较大，我们默认提供的是按量付费的模式，当您不用的时候会自动释放资源，这样可以帮您减少资费消耗\n\n#### 5 模型及插件扩展\n\n需要自己上传\n\n可以在进入admin后台管理地址之后在路径输入框输入\n/mnt/auto/sd\n然后进入models/Stable-diffusion 点击文件上传，选择”离线下载“并输入\nhttps://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt\n\n等带下载完成后需要修改文件名称，只保留sd-v1-5-inpainting.ckpt\n\n#### 6 如何构建并使用stable-diffusion-webui 镜像\n\n- 使用[stable-diffusion-webui-docker](https://github.com/AbdBarho/stable-diffusion-webui-docker)\n  镜像本地镜像构建\n- 将构建好的本地镜像托管到\n  阿里云[容器镜像服务](https://help.aliyun.com/document_detail/257112.html?spm=a2c4g.410107.0.0.5b4036b9BUO0T5)服务,\n  注意选择镜像服务的地域要跟函数计算部署的地域保持一致\n\n\u003c/usedetail\u003e\n\n\u003cdevgroup\u003e\n\n## 开发者社区\n\n您如果有关于错误的反馈或者未来的期待，您可以在\n[Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues)\n中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态，您可以通过以下渠道进行：\n\n\u003cp align=\"center\"\u003e\n\n| \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png\" width=\"130px\" \u003e |\n| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| \u003ccenter\u003e微信公众号：`serverless`\u003c/center\u003e                                                                                               | \u003ccenter\u003e微信小助手：`xiaojiangwh`\u003c/center\u003e                                                                                              | \u003ccenter\u003e钉钉交流群：`33947367`\u003c/center\u003e                                                                                                 |\n\n\u003c/p\u003e\n\u003c/devgroup\u003e\n\n## 免责声明\n\n\u003cdisclaimers\u003e\n\n1.应用中心仅为您提供应用的逻辑关系，不为您托管任何资源。如果您部署的应用中，存在一定的资源收费现象，请参考对应产品的收费标准；如果您应用所使用的某些产品或者服务因为产品规划等原因发生了不兼容变更，建议您直接咨询对应的产品或者服务；\n2.应用中心为您提供的默认流水线功能是免费的，如果您需要手动切换到自定义流水线可能涉及到资源使用费用，具体的收费标准需要参考函数计算的计费文档；\n3.应用中心部署的部分应用会为您分配“devsapp.cn”的测试域名，这个测试域名并非阿里云官方域名，是 CNCF Sandbox 项目 Serverless\nDevs 所提供的测试域名，我们不保证该域名的使用时效性，推荐您只在测试的时候使用，或者绑定自己的自定义域名进行使用；\n4.应用部署过程中，如果提示“当前应用模板由社区贡献，非阿里云官方提供，推荐您在使用当前应用模板前仔细阅读应用详情，以确保应用的安全，稳定等”则表示该应用并非阿里云官方所提供的应用，我们仅作为收录和展示，如果您继续部署该应用，推荐您联系应用的作者，并与作者协商应用使用的相关协议等；\n\n\u003c/disclaimers\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Ffc-stable-diffuson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsapp%2Ffc-stable-diffuson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Ffc-stable-diffuson/lists"}