{"id":19175811,"url":"https://github.com/connectai-e/feishu-stablediffusion","last_synced_at":"2025-07-27T02:34:57.847Z","repository":{"id":152510044,"uuid":"626167274","full_name":"ConnectAI-E/Feishu-Stablediffusion","owner":"ConnectAI-E","description":"🎭 由stablediffusion赋能的飞书图片生成类机器人","archived":false,"fork":false,"pushed_at":"2023-08-30T07:59:33.000Z","size":186,"stargazers_count":115,"open_issues_count":4,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-01T17:03:26.063Z","etag":null,"topics":["connect-ai","feishu-bot","python","stable-diffusion","stable-diffusion-webui"],"latest_commit_sha":null,"homepage":"https://www.connectai-e.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnectAI-E.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-10T23:56:20.000Z","updated_at":"2025-02-24T13:40:59.000Z","dependencies_parsed_at":"2024-01-14T12:38:37.628Z","dependency_job_id":null,"html_url":"https://github.com/ConnectAI-E/Feishu-Stablediffusion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ConnectAI-E/Feishu-Stablediffusion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Stablediffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Stablediffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Stablediffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Stablediffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnectAI-E","download_url":"https://codeload.github.com/ConnectAI-E/Feishu-Stablediffusion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Stablediffusion/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267289441,"owners_count":24064728,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["connect-ai","feishu-bot","python","stable-diffusion","stable-diffusion-webui"],"created_at":"2024-11-09T10:25:21.564Z","updated_at":"2025-07-27T02:34:57.830Z","avatar_url":"https://github.com/ConnectAI-E.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n古人云：道生一，一生二，二生StableDiffuion，StableDiffusion生万物\n\u003ca href='https://www.connectai-e.com' target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n\u003cimg width=\"1000\" alt=\"image\" src=\"https://github-production-user-asset-6210df.s3.amazonaws.com/16874002/238823929-9c9233e5-6a3e-42e4-b562-760af22143ec.png\"\u003e\n\u003c/a\u003e\n\n\u003cdetails align='center'\u003e\n\u003csummary\u003e 📷 点击展开完整功能截图 \u003c/summary\u003e\n\u003cbr\u003e\n\u003cp align='center'\u003e\n\u003ch1\u003eTxt2Img：文生图\u003c/h1\u003e\n   \u003cimg width=\"1000\" alt=\"image\" src=\"https://github.com/ConnectAI-E/Feishu-Stablediffusion/assets/16874002/af5e0beb-dbf7-4f5a-b34c-1d9b0b6976cd\"\u003e\n    \u003cimg width=\"1000\" alt=\"image\" src=\"https://github.com/ConnectAI-E/Feishu-Stablediffusion/assets/16874002/374c8f91-3662-4aaf-8f57-c8decb8771ce\"\u003e\n\u003ch1\u003eImg2Txt：图生文\u003c/h1\u003e\n    \u003cimg width=\"1000\" alt=\"image\" src=\"https://github.com/ConnectAI-E/Feishu-Stablediffusion/assets/16874002/88922eb8-89f5-40e8-ab7f-42317296ba29\"\u003e\n\u003ch1\u003eImg2Img：图生图\u003c/h1\u003e\n    \u003cimg width=\"1000\" alt=\"image\" src=\"https://github.com/ConnectAI-E/Feishu-Stablediffusion/assets/16874002/d837171c-c872-425b-9625-4e3fef11c1e7\"\u003e\n\u003c/p\u003e\n\u003c/details\u003e\n\n---\n\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n   🎭 由stablediffusion赋能的飞书图片生成类机器人\n\u003cbr\u003e\n\u003cbr\u003e\n    🚀 Feishu SD 🚀\n\u003c/p\u003e\n\n\n\n\n\n\n\n\n## 功能点\n\n- [X] txt2img: 通过正反词生成图片，支持**中英**双语\n- [X] img2img: 支持以图生图\n- [X] img2txt: 支持 clip 模型识别图片内容\n- [X] 显示StableDiffusion服务器的相关信息\n- [X] 可以选择 model\n- [X] 可以设置生成图片的 size、step 与 seed 等参数\n- [X] 显示图片生成信息\n- [ ] ControlNet\n\n---\n\n## 部署 Stable Diffusion WebUI\n\u003e 项目使用[Stable Diffusion WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui)作为后端(带 `--api`参数启动)，飞书作为前端，通过机器人，不再需要打开网页，在飞书里就可以使用StableDiffusion进行各种创作！\n\u003cdetails align='left'\u003e\n\u003csummary\u003e 📷 点击查看详细步骤 \u003c/summary\u003e\n\u003cbr\u003e\n   \n### 更新 python 版本 \n\n使用 pyenv 安装 Python 3.10.6\n\n按以下命令依次执行\n\n```\ngit clone https://github.com/pyenv/pyenv.git ~/.pyenv\ncd ~/.pyenv \u0026\u0026 src/configure \u0026\u0026 make -C src\necho 'export PYENV_ROOT=\"$HOME/.pyenv\"' \u003e\u003e ~/.bashrc\necho 'command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"' \u003e\u003e ~/.bashrc\necho 'eval \"$(pyenv init -)\"' \u003e\u003e ~/.bashrc\necho 'export PYENV_ROOT=\"$HOME/.pyenv\"' \u003e\u003e ~/.profile\necho 'command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"' \u003e\u003e ~/.profile\necho 'eval \"$(pyenv init -)\"' \u003e\u003e ~/.profile\necho 'export PYENV_ROOT=\"$HOME/.pyenv\"' \u003e\u003e ~/.bash_profile\necho 'command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"' \u003e\u003e ~/.bash_profile\necho 'eval \"$(pyenv init -)\"' \u003e\u003e ~/.bash_profile\nsudo apt install wget lzma liblzma-dev build-essential libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev \npyenv install 3.10.6\npyenv global 3.10.6\n```\n\n### 切换国内 Linux 安装镜像\n\n```\nsudo cp /etc/apt/sources.list /etc/apt/sources.list.bak\nsudo vim/etc/apt/sources.list\n\n# 修改为下列源内容\ndeb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse \ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse \ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse \ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse \ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse \ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse \ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse \ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse \ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse \ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\n# 源结束结束\n\n\nsudo apt-get update\nsudo apt-get upgrade\n```\n\n### 安装 Nvidia 驱动\n\n```\nsudo apt update\nsudo apt upgrade\nsudo apt install nvidia-driver-530 nvidia-dkms-530\nsudo reboot\n```\n\n等待重启，重新登录服务器，测试安装驱动成功\n```\nnvidia-smi\n```\n\n\n### 安装stable-diffusion-webui 并启动服务\n\n```\ngit clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git ~/stable-diffusion-webui\ncd ~/stable-diffusion-webui \u0026\u0026 bash webui.sh --api --listen\n## 等待安装完成，运行成功后，Ctrl+C停止进程，然后运行下面命令后台运行 stable-diffusion-webui\ncd ~/stable-diffusion-webui \u0026\u0026 nohup bash webui.sh --api --listen \u0026\n```\n\n\u003c/details\u003e\n\n## 部署飞书机器人\n\n1. 将*config-example.yml*复制为*config.yml*；\n2. 编辑*config.yml*，添加机器人以及 StableDiffusionWebUI 的服务器信息；\n3. （可选）创建 Python 虚拟环境 `python3 -m venv .venv \u0026\u0026 source .venv/bin/activate`；\n4. 安装依赖库 `pip install -r requirements.txt`，然后运行 `python3 src/main.py`；\n5. 其他飞书配置步骤，参考 [飞书-OpenAI](https://github.com/ConnectAI-E/Feishu-OpenAI) 部署指南 \n\n## 操作方式\n\n- 以/开头的为操作命令\n  - eg: `/model`\n- 只发文字消息为 txt2img，消息内容作为 prompt 和参数，通过#号分开正反词\n  - eg: `1girl # lowres,bad anatomy,bad hands`\n- 发图片带文字为 img2img，图片为基图，文字为 prompt 和参数\n- 只发图片为 img2txt，返回图片识别的内容\n\n## 操作命令\n\n- 不带参数的：\n\n| 命令            | 功能                                       |\n| --------------- | ------------------------------------------ |\n| /help           | 显示帮助                                   |\n| /list_models    | 显示可用的模型                             |\n| /list_sampler   | 显示可用的采样器                           |\n| /list_upscalers | 显示可用的放大器                           |\n| /host_info      | 显示最大内存，可用内存，最大显存，可用显存 |\n| /quene          | 查询当前生成队列里的任务情况               |\n| /model          | 显示当前模型                               |\n\n- 带参数的：\n\n| 命令   | 参数 | 功能                     |  |\n| ------ | ---- | ------------------------ | - |\n| /model | str  | 设置 StableDiffuion 模型 |  |\n\n## 设置关键词:\n\n- 使用关键词的格式--key [value]\n  - eg: `--sampler [DPM++ 2S a Karras] --steps [30] --height [768]`\n    (_bool 类型的不用带参数，写了就是 True_)\n\n| 参数                 | 类型  | 功能                        | 默认值    |\n| -------------------- | ----- | --------------------------- | --------- |\n| --sampler            | str   | 设置采样器                  | \"Euler a\" |\n| --steps              | int   | 设置采样步数                | 20        |\n| --width              | int   | 设置宽度                    | 512       |\n| --height             | int   | 设置高度                    | 512       |\n| --batch_size         | int   | 设置批次大小                | 1         |\n| --batch_count        | int   | 设置批次数量                | 1         |\n| --seed               | int   | 设置种子                    | -1        |\n| --cfg_scale          | float | 设置提示词的控制度          | 7.0       |\n| --restore_faces      | bool  | 设置是否修复面容            | False     |\n| --enable_hr          | bool  | 设置是否高清修复            | False     |\n| --hr_upscaler        | str   | 设置放大器                  | Latent    |\n| --hr_scale           | flat  | 设置放大倍率                | 2         |\n| --denoising_strength | float | 设置重绘强度                | 0.7       |\n| --resize_mode        | int   | 设置缩放模式                | 0         |\n\n## 探索企联AI\n\n| \u003cdiv style=\"width:200px\"\u003eAI\u003c/div\u003e |             \u003cimg width=120\u003e SDK \u003cimg width=120\u003e              |                         Application                          |\n| :-------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |\n|              🎒OpenAI              |    [Go-OpenAI](https://github.com/ConnectAI-E/Go-OpenAI)     | [🏅Feishu-OpenAI](https://github.com/ConnectAI-E/Feishu-OpenAI), [🎖Lark-OpenAI](https://github.com/ConnectAI-E/Lark-OpenAI), [Feishu-EX-ChatGPT](https://github.com/ConnectAI-E/Feishu-EX-ChatGPT), [🎖Feishu-OpenAI-Stream-Chatbot](https://github.com/ConnectAI-E/Feishu-OpenAI-Stream-Chatbot), [Feishu-TLDR](https://github.com/ConnectAI-E/Feishu-TLDR),[Feishu-OpenAI-Amazing](https://github.com/ConnectAI-E/Feishu-OpenAI-Amazing), [Feishu-Oral-Friend](https://github.com/ConnectAI-E/Feishu-Oral-Friend), [Feishu-OpenAI-Base-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-Base-Helper), [Feishu-Vector-Knowledge-Management](https://github.com/ConnectAI-E/Feishu-Vector-Knowledge-Management), [Feishu-OpenAI-PDF-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-PDF-Helper), [🏅Dingtalk-OpenAI](https://github.com/ConnectAI-E/Dingtalk-OpenAI), [Wework-OpenAI](https://github.com/ConnectAI-E/Wework-OpenAI), [WeWork-OpenAI-Node](https://github.com/ConnectAI-E/WeWork-OpenAI-Node), [llmplugin](https://github.com/ConnectAI-E/llmplugin) |\n|             🤖 AutoGPT             |                            ------                            | [🏅AutoGPT-Next-Web](https://github.com/ConnectAI-E/AutoGPT-Next-Web) |\n|         🎭 Stablediffusion         |                            ------                            | [🎖Feishu-Stablediffusion](https://github.com/ConnectAI-E/Feishu-Stablediffusion) |\n|           🍎 Midjourney            | [Go-Midjourney](https://github.com/ConnectAI-E/Go-Midjourney) | [🏅Feishu-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney), [🔥MidJourney-Web](https://github.com/ConnectAI-E/MidJourney-Web), [Dingtalk-Midjourney](https://github.com/ConnectAI-E/Dingtalk-Midjourney) |\n|            🍍 文心一言             |    [Go-Wenxin](https://github.com/ConnectAI-E/Go-Wenxin)     | [Feishu-Wenxin](https://github.com/ConnectAI-E/Feishu-Wenxin), [Dingtalk-Wenxin](https://github.com/ConnectAI-E/Dingtalk-Wenxin), [Wework-Wenxin](https://github.com/ConnectAI-E/Wework-Wenxin) |\n|             💸 Minimax             |   [Go-Minimax](https://github.com/ConnectAI-E/Go-Minimax)    | [Feishu-Minimax](https://github.com/ConnectAI-E/Feishu-Minimax), [Dingtalk-Minimax](https://github.com/ConnectAI-E/Dingtalk-Minimax), [Wework-Minimax](https://github.com/ConnectAI-E/Wework-Minimax) |\n|             ⛳️ CLAUDE              |    [Go-Claude](https://github.com/ConnectAI-E/Go-Claude)     | [Feishu-Claude](https://github.com/ConnectAI-E/Feishu-Claude), [DingTalk-Claude](https://github.com/ConnectAI-E/DingTalk-Claude), [Wework-Claude](https://github.com/ConnectAI-E/Wework-Claude) |\n|              🥁 PaLM               |      [Go-PaLM](https://github.com/ConnectAI-E/go-PaLM)       | [Feishu-PaLM](https://github.com/ConnectAI-E/Feishu-PaLM),[DingTalk-PaLM](https://github.com/ConnectAI-E/DingTalk-PaLM),[Wework-PaLM](https://github.com/ConnectAI-E/Wework-PaLM) |\n|             🎡 Prompt              |                            ------                            | [📖 Prompt-Engineering-Tutior](https://github.com/ConnectAI-E/Prompt-Engineering-Tutior) |\n|             🍋 ChatGLM             |                            ------                            | [Feishu-ChatGLM](https://github.com/ConnectAI-E/Feishu-ChatGLM) |\n|            ⛓ LangChain            |                            ------                            | [📖 LangChain-Tutior](https://github.com/ConnectAI-E/LangChain-Tutior) |\n|            🪄 One-click            |                            ------                            | [🎖Awesome-One-Click-Deployment](https://github.com/ConnectAI-E/Awesome-One-Click-Deployment) |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectai-e%2Ffeishu-stablediffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnectai-e%2Ffeishu-stablediffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectai-e%2Ffeishu-stablediffusion/lists"}