fix(prompt+removeBg): native endpoint + critique + max-preview (T-121) - #11
Open
DaleXiao wants to merge 1 commit into
Open
fix(prompt+removeBg): native endpoint + critique + max-preview (T-121)#11DaleXiao wants to merge 1 commit into
DaleXiao wants to merge 1 commit into
Conversation
…#10) Three small surgical fixes backed by 5-case offline evidence (10 images): A. removeBackground: COMPAT_API_URL -> DASHSCOPE_SUBMIT_URL (native endpoint) wan2.7-image-pro image-edit ability is NOT exposed via OpenAI compat layer. Prod silently swallowed errors and returned the original white-bg image. Offline: compat-mode 0/6, native 8/10. Real root cause for the 'all-white' user complaints. B. PROMPT_MODEL: qwen3.6-plus -> qwen3.6-max-preview enable_thinking already on. One-line change. C. critique pass: second LLM call detects 4 drift classes (D1 subject_replacement / D2 keyword_omission / D3 style_inversion / D4 topic_drift) and emits a fixed pair when verdict=fix. Adds the counterexample reasoning only; SYSTEM_PROMPT positive examples untouched. Offline hit rate: 2/5 (40%). Best-effort: any failure falls back silently to the original variants. Out of scope (deliberately not done): - vl-plus visual verification (latency vs. marginal gain) - retry on failed cut (one-shot, fall back to original) - alternative cut backends (birefnet etc.) Closes #10 Refs T-121
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.
Closes #10. Refs T-121.
Changes (3 surgical, all in
worker/src/index.ts)A. removeBackground → native endpoint (真根因)
COMPAT_API_URL→DASHSCOPE_SUBMIT_URL(/api/v1/services/aigc/multimodal-generation/generation)messages[].content[{type:image_url,...}]→ nativeinput.messages[].content[{image},{text}]data.choices[0].message.content→data.output.choices[0].message.content[0].imagetry{}catch{}静默吞错,所以用户看到的「白底」=原图B. PROMPT_MODEL → qwen3.6-max-preview
qwen3.6-plus→qwen3.6-max-previewenable_thinking: true已在(line 324),无需改动C. critique pass (新增反例库)
synthesizePrompts解析校验完后追加第二次 LLM 调用SYSTEM_PROMPT_CRITIQUE:仅检测 4 类 drift(D1 subject_replacement / D2 keyword_omission / D3 style_inversion / D4 topic_drift)不做
验证
npx tsc --noEmit✅(仅遗留的stateunused warning,main 上已存在)清理
COMPAT_API_URL常量