【超简单】无需服务端!5 分钟让 NextChat 用上最新 硅基流动 绘图!!

【准备工作】先拿到 Key:AFF 用邀请码注册双方各得 2000万Tokens

即可。 无需 Cloudflare Worker 或其他什么中转。

然后打开你的 NextChat,如果你的版本太旧不支持插件你可以先用我的 GPT-4 风格高级灰版: https://15.cn-gpt.wiki

点击左上的【发现】→【Plugins】→ 新建:

授权方式选 Bearer ,Token 填你最上面拿到的 硅基流动 的 Key,纯新人不知道 Key 在哪拿的话可以先用这个:

sk-xcdcquzwbsycxgadtwijeetzukhroyeorzqqzfvrtwrlmqrs

当前余额 ¥12.34。

之后将这里的 Schema 代码全选复制粘贴到下面小黑框里:

点击展开 OpenAPI 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 里:

点击展开 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

![created]\(images.url)

↑ 这里对应的是响应的键名,取其键值即可。如果用户请求了多张图响应略有不同时你就自行优化。

具体细节你可以自己改,面向 Prompt 编程.jpg

然后就可以直接用了,效果:

以上。教程结束。


PS. 需要模型本身支持 FC 就是 Tools – Function Calling,一众旗舰模型例如 GPT-4o、Sonnet、GLM-4-Plus 都是肯定支持的无需管这个。

若使用硅基流动家模型的话现在只有 2 个模型支持 – 首选智谱的「 Pro/THUDM/glm-4-9b-chat」比官方那个 AIR 执行得好很多、Qwen 系列除最新的 128K 那个外也支持但会有调用前缀声明强迫症体验不太好。DeepSeek 支持 FC 但最近变得不听指令不肯调用插件。


以及上面 15 那个 nextchat 添加了硅基流动家的视觉模型:

  • Qwen/Qwen2-VL-72B-Instruct
  • OpenGVLab/InternVL2-26B
  • OpenGVLab/InternVL2-Llama3-76B
  • Pro/Qwen/Qwen2-VL-7B-Instruct
  • Pro/OpenGVLab/InternVL2-8B

就是当你自定义这几个模型的时候会出现「上传图像」的按钮,官方原版还没加这几个模型就没有上传按钮。

209 个赞

感谢大佬分享

9 个赞

感谢大佬分享

11 个赞

#StableDiffusion添加

大佬的高级版可以长期用吗

13 个赞

感谢大佬的分享,等会试下

3 个赞

:bili_040: 那个是吹水的,就是 Github 项目官方的 2.15.1 Docker 平民版(2.15.3 版之后才有付费版广告)简单改下颜色。。

这域名我就长期挂着这网站了刷邀请码用。。只要我作梯子用的上古 VPS 不宕机都能用,只是一个前端基本不占资源。你自定义的接口那些是直接请求到你填的域名不经过 VPS 的。

5 个赞

感觉速度很快,很好用的

4 个赞

报这个,是什么为问题

Error 1101 Ray ID: 8d782046ef22980f • 2024-10-24 07:06:46 UTC

Worker threw exception

What happened?

You’ve requested a page on a website (free.zeroai.chat) that is on the Cloudflare network. An unknown error occurred while rendering the page.

What can I do?

If you are the owner of this website:
you should login to Cloudflare and check the error logs for free.zeroai.chat.

Cloudflare Ray ID: 8d782046ef22980f • Your IP: Click to reveal 240e:87c:8b7:dabc:3847:377:a459:7e0 • Performance & security by Cloudflare

3 个赞

这是 Cloudflare 的默认界面(伪),我鸡子 404 就会指向这个。你 http 打少了个 s 吧,你是在点击那个 https://15.cn-gpt.wiki

2 个赞

自己的chat,是生成图片时显示这个

2 个赞

哦哦,看到了,你上游 free.zeroai.chat 撞 Cloudflare 盾墙了。我那个插件是直接指向硅基流动官方接口的,不知道硅基官方有没有对外网做什么限制。

9 个赞

这些插件你可以整些国产 AI 去用,消耗的 Tokens 比较多,国产各家新用户基本都是免费,硅基流动自家的 DeepSeek 就很适合。

成功了,就是图片质量太差

难道是我开的代理问题?我试试

5 个赞

:bili_040: 把 Prompt 的 model 改成

Pro/black-forest-labs/FLUX.1-schnell

或者

black-forest-labs/FLUX.1-dev

前者超快,后者质量高一点,FLUX.1 是白嫖绘图里的 T1 了,用 Stable Diffusion 3.5 Large 举例完全是因为它最新。。

9 个赞

这个能在chatbox上使用吗?没看到哪里设置插件

7 个赞

没用过 chatbox 不知道,2.15.0 之前版本的 NextChat 也是没有插件的,你可以把 Schema 那段丢给 Claude 问问,我也是把另一个插件 WebPilot 的 Schema 丢给 Claude 3.5 Sonnet 然后牠给我写了这个插件。。

4 个赞

:bili_040: 这里放一个佬友智普清言版本的:

问就是可以在那边顶楼插入一条关联友链。。

4 个赞

原来nextchat还有这用法。。。可惜我已经换到openwebui上了

4 个赞