admin and Claude Opus 4.8
7313c8a443
fix(ai-outfit): 停止生成打断当前目录行 + 「停止中…」反馈 (§19.24)
...
修「开始生成→几秒后停止→两个按钮都灰几十秒像卡死」:非死锁,是温和停止
在等当前目录行收尾,而 _generate_directory_outfit 一次性 submit 全部图片、
shutdown(wait=True) 等全跑完,停止信号进不到该循环;且 _stop 后无反馈。
- outfit_batch:run() 经 _accepts_should_stop 给 generate_func 传 should_stop
(= _stop_event.is_set),2-arg 才传、1-arg 仍兼容(含既有 mock)
- ai_outfit:generate_outfit_image/_generate_directory_outfit 增 should_stop;
目录循环改有界提交——始终最多 image_concurrency 张在飞,每张完成后、提交
下一张前查 should_stop,已停止则停止提交、在飞收尾即返回(结果注明
「已停止,N 张未生成」,已生成的带 output_paths)
- 面板:_OutfitWorker.gen(task, should_stop) 透传;_stop() 把停止按钮改
「停止中…」;_set_running(False) 复位「停止生成」
测试:目录行 should_stop 触发后只生成到停止点、返回「已停止」结果;2-arg
generate_func 收到 should_stop;既有用例(1-arg mock、目录并发/部分失败)保持绿。
全套 py37 通过(test_config_service 的 packaging 模板失败属并行 §19.13,无关)。
离屏冒烟:stop 截断 run 且 runner 及时返回;面板停止按钮「停止中…」→结束复位。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-23 16:46:49 +08:00
admin
e83dd07dc0
feat: use image concurrency for outfit directories
2026-06-22 18:10:54 +08:00
admin
5b5ee119ad
feat: add outfit output directory
2026-06-22 17:49:59 +08:00
admin and Claude Opus 4.8
9a61a432d9
fix(ai-outfit): 货号(B列)改为可选,空货号不再跳过整行 (§19.14)
...
用户表的「商品id(货号)」整列为空时,行有效性判定(标题+货号+图三者非空)
把每一行都判为不完整 → read_all_rows 与 load_outfit_tasks 都返回 0:预览下拉
只剩占位符,且「开始生成」也判定无待处理行。货号不进提示词、目录行输出名沿用
源图名,对该用法是多余约束。
- excel_service.py: read_all_rows / load_outfit_tasks 完整性判定改为只要求
标题 + 衣服图路径 非空,货号可空(状态过滤不变)
- core/ai_outfit.py: 单文件行货号为空时输出名回退 Path(garment).stem
(货号非空仍用 货号.jpg);目录行不变
- ai_outfit_panel.py: 样本下拉标签货号为空显示「(无货号)」
- tests: 空货号行被 read_all_rows/load_outfit_tasks 收录、单文件空货号按源图名命名
- docs/11 §4(表+规则)/§9(命名回退)、tasks.md §19.14
离屏冒烟:标题填/货号空/C=目录 → 预览下拉有行、生成产出到子目录、E=完成;
全套测试在 Python 3.7 全绿(test_config_service 的失败属并行的出厂模板工作,与本次无关)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 17:15:05 +08:00
admin and Claude Opus 4.8
abe46c4aeb
feat(ai-outfit): C 列支持图片目录 → 多图扇出到同名子目录 (§19.12)
...
Excel C 列除单张图片外也可填一个目录(d:/images/a/):对目录内每张图各
生成一张穿搭图(N→N),全部存到 输出目录/<目录叶子名>/,文件名沿用源图名;
Excel 仍整行一个状态:D=子目录、E=全成功才「完成」、F=失败张数/原因。
- core/ai_outfit.py: list_directory_images(顶层、扩展名过滤、排序、忽略子目录)、
make_outfit_subdir_path(不加 _n 后缀)、generate_outfit_image 目录分支
(新参 request_interval/image_log;逐张跳过已存在→幂等重试、本地节流、发日志、
聚合成单个 OutfitResult)
- core/models.py: OutfitResult 加 output_paths(目录行各 jpg,供缩略图)
- ai_outfit_panel.py: gen 闭包传 request_interval/image_log;缩略图逐张;
明细「结果」列显示「子目录(N 张)」;_basename 处理目录末尾分隔符
- tests/test_ai_outfit.py: 扇出/幂等跳过/空目录/缺目录/部分失败/命名过滤等用例
- docs/11 §4.1+§9.1、tasks.md §19.12
离屏冒烟:3 图目录 + mock API → output/<dir>/ 3 jpg、D=子目录、E=完成、缩略图 3 张;
全套 12 测试文件在 Python 3.7 全绿。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 17:03:04 +08:00
admin and Claude Opus 4.8
d4082ec477
feat(ai-outfit): auto-append output requirements to prompt (§19.6)
...
- core/ai_outfit: OUTPUT_REQUIREMENTS constant + build_output_requirements();
render_prompt(template, task, resolution=None) appends the block when a
resolution is given; generate_outfit_image passes the current resolution.
- ai_outfit_panel: inline preview now uses render_prompt/build_output_requirements
with the selected resolution and refreshes when the resolution combo changes,
so the preview equals what is actually sent.
- tests: +3 cases (tail with resolution, none without, helper empty/filled);
updated the success test for the appended tail. Full suite (12 files) green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 10:40:28 +08:00
admin
28fcc018bc
feat: add outfit generation core
2026-06-18 17:43:35 +08:00