-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2972fbe
commit 64f3906
Showing
1 changed file
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
# StableDiffusion-Telegram-Bot | ||
搭配[Hugging Face](https://huggingface.co/models)使用的图片生成机器人 | ||
> [!TIP] | ||
> 需注册Hugging Face账号,在个人信息profile处点击settings-access tokens生成api复制备用 | ||
> [!NOTE] | ||
> 该代码仅兼容StableDiffusion模型,其他模型未测试 | ||
`.env` | ||
```bash | ||
HUGGINGFACE_TOKEN=hf_ABCDEFGHIJKLMNOPQRSTUVWXYZ | ||
BOT_TOKEN=123456789:abcdefghijklmnopqrstuvwxyz | ||
API_URL=https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1 | ||
``` | ||
(必填)HUGGINGFACEHUB_TOKEN:填入tip提到的api | ||
(必填)BOT_TOKEN:电报机器人token | ||
(必填)API_URL:调用模型的API链接,可在HuggingFace的模型详情页面右上方Deploy-Inference API查看 | ||
`docker-compose.yml` | ||
```bash | ||
services: | ||
chatgpt: | ||
image: sheepgreen/sdbot | ||
container_name: sdbot | ||
volumes: | ||
- ./.env:/app/.env | ||
restart: always | ||
``` | ||
以上两个文件放同一目录,然后运行`docker-compose up -d`命令即可 |