【准备工作】先拿到 Key:用邀请码注册双方各得 2000万Tokens
即可。 无需 Cloudflare Worker 或其他什么中转。
然后打开你的 NextChat,点击左上的【发现】→【Plugins】→ 新建:
授权方式选 Bearer ,Token 填你最上面拿到的 硅基流动 的 Key。
之后将这里的 Schema 代码全选复制粘贴到下面小黑框里:
openapi: 3.0.1
info:
title: SiliconImagen
description: A plugin to generate images using SiliconFlow API
version: 'v1.0'
servers:
- url: https://api.siliconflow.cn
paths:
/v1/images/generations:
post:
operationId: generateImage
x-openai-isConsequential: false
summary: Generate an image based on text prompt
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
prompt:
type: string
description: The text prompt to generate image from. If input cannot be translated to English, use "a question mark, centered, white background, simple, minimalistic"
model:
type: string
default: "stabilityai/stable-diffusion-3-5-large"
image_size:
type: string
default: "1024x1024"
enum: ["1024x1024", "512x1024", "768x512", "768x1024", "1024x576", "576x1024"]
batch_size:
type: integer
default: 1
num_inference_steps:
type: integer
default: 25
guidance_scale:
type: number
default: 7.5
required:
- prompt
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
images:
type: array
items:
type: object
properties:
url:
type: string
timings:
type: object
properties:
inference:
type: number
seed:
type: integer
shared_id:
type: string
data:
type: array
items:
type: object
properties:
url:
type: string
created:
type: integer
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
粘贴完后按一下 Tab 键(焦点移出黑框即可)下面多出一个 generateImage,插件就配置完毕了。
最后一步,将下述 Prompt 粘贴到你对话的 System Prompt 里:
将用户发送的内容转译成英文 Prompt,调用 SiliconImagen 插件为用户生成图片。
**若用户不指定其他参数,则使用下述参数:**
>**model**: Pro/black-forest-labs/FLUX.1-schnell
**image_size**: 768x512
**batch_size**: 1
**num_inference_steps**: 25
**guidance_scale**: 7.5
可选尺寸:`1024x1024`, `512x1024`, `768x512`, `768x1024`, `1024x576`, `576x1024 `
接收到插件响应后按下述格式输出,*输出转译后的 Prompt 的内容无需标题*:
*直接输出 Prompt 的内容!
>耗时:timings.inference、Seed:seed

↑ 这里对应的是响应的键名,取其键值即可。如果用户请求了多张图响应略有不同时你就自行优化。
完毕。然后在 首次对话 前点一下最右图标 选中弹出的 SiliconImagen 即可:
可以直接在 prompt 修改参数,例如将 model 直接修改为 FLUX.1:
不支持的参数会自动忽略,插件没有的 prompt 参数大模型会帮你整合进请求里。模型与参数自行去硅基流动官网对,以上。