Skip to content

免费渠道的 Flux 文生图 API,同时兼容 OpenAI 的 Image 和 Chat 接口,支持自动翻译 Prompt,可以直接接入 one-api / one-hub / new-api 等中转平台

License

Notifications You must be signed in to change notification settings

k8scat/flux-api

Folders and files

NameName
Last commit message
Last commit date
Aug 29, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024
Aug 27, 2024

Repository files navigation

Flux-API

免费渠道的 Flux 文生图 API,同时兼容 OpenAI 的 Image 和 Chat 接口,支持自动翻译 Prompt,可以直接接入 one-api / one-hub / new-api 等中转平台

演示地址:openai-all.com

生成图片:

免费渠道

运行

docker run -d -p 8080:8080 --name flux-api k8scat/flux-api:latest

Flux 对中文理解不好,支持开启自动翻译功能:

docker run -d -p 8080:8080 --name flux-api \
    -e TRANSLATE_ENABLE=true \
    -e TRANSLATE_API_BASE=https://api.openai-all.com \
    -e TRANSLATE_API_KEY=sk-xxx \
    -e TRANSLATE_MODEL=gpt-4o \
    -e TRANSLATE_PROMPT_TEMPLATE="Translate into English: %s" \
    k8scat/flux-api:latest

使用说明

兼容 Image 接口

curl http://127.0.0.1:8080/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer #AUTH" \
  -d '{
    "model": "#MODEL",
    "prompt": "A cute baby sea otter",
    "n": 1,
    "size": "1024x1024"
  }'

兼容 Chat 接口

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer #AUTH" \
  -d '{
    "model": "#MODEL",
    "messages": [
      {
        "role": "user",
        "content": "A cute baby sea otter"
      }
    ]
  }'

SiliconFlow 配置

GetimgAI 配置

  • #MODEL => 固定值 flux-v1
  • #AUTH => GetimgAI 浏览器登录后的完整 Cookie

交流群

开源许可

MIT

About

免费渠道的 Flux 文生图 API,同时兼容 OpenAI 的 Image 和 Chat 接口,支持自动翻译 Prompt,可以直接接入 one-api / one-hub / new-api 等中转平台

Topics

Resources

License

Stars

Watchers

Forks