feat(panai-media): 市场客服照片生成 — 图片 MCP(参数化+4K/8K真超分)#52
Open
ActiveInAI wants to merge 4 commits into
Open
Conversation
视频 MCP(panai_video_gen_mcp.mjs):
- 策略改为 Agnes 云端优先、默认 10s/1080p;仅 Agnes 失败才退本机 ComfyUI 安全档
- Agnes 多段 5s + 末帧图生续接 + ffmpeg 拼接出长片(本机原生1080p/长片会OOM撑崩)
- 嵌套轮询(data.{status,progress})+ 0% 停滞守卫 + create/poll 重试 + 显式 resolution/size
- 新增参数 resolution/duration_seconds/backend;本机降级安全档(≤73帧/768×512)避免崩机
图片 MCP(panai_image_gen_mcp.mjs,新):内置 panai_image_generation drop-in 升级
- 按需选后端(auto→Agnes/local→FLUX)+ 给宽高则 ffmpeg cover-crop 到精确尺寸
- 经 engine_server 7071 多 provider 出图;失败兜底另一后端
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 比例 aspect_ratio(1:1/16:9/9:16/4:3/3:2/21:9… 或自定义 W:H) - 分辨率 resolution(1k/hd/fhd/2k/4k 或长边px),computeSize 算精确 W×H(/8 取整) - 画质 quality(standard/hd 透传)、风格 style(archviz/photoreal/3d/anime… 注入提示词) - Agnes 原生出任意尺寸(传 size=WxH;aspectRatio 无效);ensureSize 仅在尺寸不符时 cover-crop 兜底 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- quality 与 resolution 同义,共用档位表 TIERS;quality 覆盖 720p/1080p/2k/4k/8k - Agnes 图像原生最多约 2K(实测 2560 可、4K/8K 报错);超 2K 自动 lanczos 放大到目标并注明 - 移除 quality 作为 Agnes 渲染参数(改为分辨率档),size cover-crop 改 lanczos Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 超 2K 时经 ComfyUI UpscaleModelLoader+ImageUpscaleWithModel(RealESRGAN_x4plus)x4 真超分, 再 ffmpeg 降采样到精确目标(比 lanczos 清晰);超分不可用才回退 lanczos - 修 readFileSync 未 import 导致 token 读空、超分静默回退的 bug - 模型需放 ~/ComfyUI/models/upscale_models/RealESRGAN_x4plus.pth(env COMFY_UPSCALE_MODEL 可换) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
市场客服照片生成 — panai-media 图片/视频 MCP
把 panai-media 的图片生成能力从特性分支独立出来,干净并入 main(仅改
tools/两个文件,无其他 WIP)。包含的 4 个提交
视频/图片 MCP— Agnes 优先云端长片 + 图片按需后端尺寸(新建panai_image_gen_mcp.mjs)图片 MCP 全参数化— 风格/比例/分辨率/画质均可自定义图片画质档位— 覆盖 720p/1080p/2k/4k/8k4K/8K 接 Real-ESRGAN 真超分— 替代 lanczos链路
Agnes 云端(
agnes-image-2.1-flash) 优先 → 失败兜底本地 FLUX.2-dev → 4K/8K 经 ComfyUI Real-ESRGAN 真超分。经由
engine_server(:7071) 文生图 +ComfyUI(:8188) 超分。影响面
tools/panai_image_gen_mcp.mjs(新建)tools/panai_video_gen_mcp.mjs(增强)🤖 Generated with Claude Code