feat(store): NovelAIGen 升级至 v2.1.0 — 八命令全端点网关与中转站支持 - #7
Open
infinite-vector wants to merge 1 commit into
Open
Conversation
…lti-channel, relay support)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
将插件商店中的 NovelAIGen 从 v1.0.0 升级至 v2.1.0。原版仅支持文生图单一命令;
本版覆盖 NovelAI 的全部六个端点共八条命令,并新增多渠道容错与第三方中转站支持。
原作者署名
VCP-Assistant完整保留,本次重构以追加形式记入 author 字段。元数据变化
新增能力
命令覆盖:文生图、图生图、局部重绘(infill)、图片放大、Director 工具
(emotion / colorize / lineart / sketch / declutter / bg-removal)、Vibe 编码、
标签建议、订阅查询。
多角色提示词:支持 V4 起引入的
v4_prompt三层结构,最多 6 个角色,每个角色可带独立的负面提示词与画面坐标。支持
source#/target#/mutual#角色交互语法。
模型三维解析:按版本 × 分级 × 用途解析模型标识符。inpaint 会自动切换到对应的
-inpaintingcheckpoint(这是独立训练的权重,不是运行时开关);无对应变体时沿降级链选择,并在返回结果中显式告知实际使用的模型。
多渠道与能力位:渠道语法为
URL|KEY|MODELS|CAPS|PATH_PREFIX。按能力位过滤后洗牌遍历,单渠道失败自动切换下一个,全部失败时聚合报错并逐行列出原因(含 URL 与
模型名,不含密钥)。429/500/502/503/504 按指数退避重试。
中转站支持:部分第三方站点在 NovelAI 原生路由前加路径前缀(如
/native)。新增
NOVELAI_PATH_PREFIX配置项与渠道语法第五段。前缀留空时拼接结果与不带前缀完全相同,官方直连用户无需改动配置。
subscription命令按渠道是否有前缀分流——中转站通常与图像 API 同域,官方账户 API 在独立域名。
响应解析:ZIP、JSON、单图三种形态分流处理。JSON 分支包含四级图片提取
(images[] / data[] / 结构化 content[] / 全文 data URI 扫描),适配不同站点的
响应封装差异。MessagePack 响应会给出明确提示而非输出乱码。
安全:调试日志脱敏(base64 替换为长度标记,token/key/authorization 替换为
占位符);图片落盘前做路径逃逸校验;错误聚合信息不含密钥。
已实测
以下能力经真实 API 调用验证(渠道为 nai.rinko.ai,走
/native前缀):source#/target#标注下攻防姿态正确呈现未验证:官方直连路径未做真实调用。前缀机制设计为空前缀时与原拼接方式
逐字等价(
url + "" + endpoint),但仅有源码层面的等价性论证。inpaint、Vibe 编码、upscale、suggest_tags 四条命令亦未实测。
兼容性
/v1/models实证,官方直连是否接受同一 ID 未验证;如遇拒绝可用
MODEL_ALIASES覆盖)nai-diffusion-4-5-full的变体——该变体仅在中转站模型列表中出现,若内置会让官方用户从"降级可用"退化为
"直接报错"。需要时通过
INPAINT_MODELS配置添加依赖
axios 1.7.9 / uuid 11.0.5 / yauzl 3.2.0 / https-proxy-agent 7.0.6 /
http-proxy-agent 7.0.2。版本全部写死,无范围符。
检查
node --check NovelAIGen.js通过plugin-manifest.json/package.jsonJSON 解析通过config.env主要拿着某中转站小小测试了一番,官方的各种没有测试。而且novelai还挺日新月异的,难免过时或小错谬