@kevlns/art-workshop 0.3.8 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -0
- package/art-workshop.mjs +19 -10
- package/docs/commands.md +103 -50
- package/docs/deployment.md +15 -43
- package/docs/local-models/qwen-image-2.1.json +55 -0
- package/docs/local-models/qwen-image-2.1.md +31 -0
- package/lib/agent.mjs +1 -1
- package/lib/deployment-guide.mjs +12 -0
- package/lib/environment-operations.mjs +49 -0
- package/lib/environments.mjs +20 -35
- package/lib/style-bundle.mjs +85 -0
- package/package.json +1 -1
- package/skills/art-workshop/SKILL.md +9 -0
- package/v-cli.plugin.json +223 -100
- package/lib/deployment-process.mjs +0 -19
- package/lib/deployment-source.mjs +0 -24
- package/lib/deployment-worker.mjs +0 -86
- package/lib/deployment.mjs +0 -75
package/AGENTS.md
CHANGED
|
@@ -65,6 +65,15 @@ candidate delete 先确认影响,拒绝运行中或被计划/底图引用的
|
|
|
65
65
|
|
|
66
66
|
`v-cli capability coverage --json` 核对结构化调用覆盖。参考导入的 `--item-id` 指定当前任务出图对象,省略表示任务共用;工具校验对象身份。
|
|
67
67
|
|
|
68
|
+
### 本地环境部署
|
|
69
|
+
|
|
70
|
+
使用 environment guide 获取部署指南与契约,environment inspect 读取机器环境。Pi 通过基础工具和动态工作流完成安装、下载、修正与采样;environment verify 独立校验文件、服务和节点,environment register 验收后登记。任务授权、进程、互斥与恢复交由 Harness。不得把模型回复或服务连通当作真实出图。unregister 仅解除登记,不删除模型或停止外部服务。按 --guide 选择随包方案,模型事实和启动参数只由 art 维护。
|
|
71
|
+
|
|
72
|
+
### 共享冻结风格
|
|
73
|
+
|
|
74
|
+
用户要求共享时使用 style export --project ID --id STYLE --out FILE.style.json,收集冻结核心和必要参考,不复制运行记录或设置。style sources --input DIRS.json 只读列出多个来源,单个来源不可用时报告并继续,重复身份内容冲突按来源明确选择。style import --project TARGET --file FILE.style.json 导入固定快照,保留来源身份、版本及核心哈希;不重新分析、采用或随来源更新。导入的冻结对象只读,改动使用 style derive。输出文件不覆盖已有版本。
|
|
75
|
+
|
|
76
|
+
|
|
68
77
|
## 结果验证
|
|
69
78
|
|
|
70
79
|
核对原始错误、任务身份、停止状态及实际产物。只报告已经完成的验证,模拟测试与真实执行分别说明。
|
package/art-workshop.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {join,resolve} from 'node:path';
|
|
|
4
4
|
import {readJson,writeJson} from './lib/shared.mjs';
|
|
5
5
|
const args=process.argv.slice(2),pos=[],options={};
|
|
6
6
|
if(args.length===1&&['--version','-V'].includes(args[0])){console.log(readJson(new URL('./package.json',import.meta.url)).version);process.exit(0);}
|
|
7
|
-
const help='art-workshop: config path/show/init/validate | doctor [--backend ID] [--start] | workflow list |
|
|
7
|
+
const help='art-workshop: config path/show/init/validate | doctor [--backend ID] [--start] | workflow list | environment guide/list/inspect/verify/register/unregister | refs guide | agent index/docs/init | list | style export/import/sources/create/list/read/update/derive/discard/analyze/resolve/adopt/recover/validate/show | generate show/plan/run | edit show/plan/run | task list/status/wait/cancel/recover/resume | shutdown | check RUN | project init/upgrade | job template/from-candidate/create/list/read/update/derive/discard/analyze | reference import/list/update/remove | candidate list/finalize/delete/finalizations | compare PLAN PLAN\nrun --background 返回任务 ID;--backend 选择后端。shutdown 停止当前工作区关联任务,核验共享队列和进程身份后关闭本地服务。\n也可用 v-cli art 调用;先 v-cli agent docs art,再 v-cli agent describe art --json 查看完整参数。';
|
|
8
8
|
if(!args.length||args.length===1&&['--help','-h','help'].includes(args[0])){console.log(help);process.exit(0);}
|
|
9
9
|
const {loadJob,loadProject}=await import('./lib/project.mjs');
|
|
10
10
|
const {referenceRoot,referenceGuide}=await import('./lib/refs.mjs');
|
|
@@ -25,9 +25,11 @@ const {candidates,finalize,deleteCandidate,finalizations,editFromCandidate}=awai
|
|
|
25
25
|
const {upgradeProject}=await import('./lib/migration.mjs');
|
|
26
26
|
const {workflowList}=await import('./lib/workflows.mjs');
|
|
27
27
|
const {jobTemplate}=await import('./lib/templates.mjs');
|
|
28
|
-
const {
|
|
28
|
+
const {deploymentGuide}=await import('./lib/deployment-guide.mjs');
|
|
29
|
+
const {inspectInstallation,discoverInstallations}=await import('./lib/environments.mjs');
|
|
30
|
+
const {verifyInstallation,registerInstallation,unregisterInstallation}=await import('./lib/environment-operations.mjs');
|
|
29
31
|
const flags=new Set(['dry','explore','background','start','replace','confirm','all-variants']);
|
|
30
|
-
const allowed=new Set(['config','workspace','output-dir','refs-dir','cache-dir','directory','endpoint','project','input','out','report','note','core','job','plan','item','variant','offset','limit','file','backend','timeout','kind','id','revision','source','category','purposes','mapping','run','candidate','actor','operation','retry-run','item-id',...flags]);
|
|
32
|
+
const allowed=new Set(['config','workspace','output-dir','refs-dir','cache-dir','directory','endpoint','guide','project','input','out','report','note','core','job','plan','item','variant','offset','limit','file','backend','timeout','kind','id','revision','source','category','purposes','mapping','run','candidate','actor','operation','retry-run','item-id',...flags]);
|
|
31
33
|
for(let i=0;i<args.length;i++){if(args[i].startsWith('--')){const k=args[i].slice(2);if(!allowed.has(k)||k in options) throw new Error('未知或重复参数 '+k);options[k]=flags.has(k)?true:args[++i];if(options[k]===undefined) throw new Error('参数缺少值 '+k);}else pos.push(args[i]);}
|
|
32
34
|
const print=x=>console.log(JSON.stringify(x?.schema==='art-workshop/style'?styleView(settings.paths.workspace,x):x,null,2));
|
|
33
35
|
if(pos[0]==='workflow'&&pos[1]==='list'){print(workflowList());process.exit(0);}
|
|
@@ -48,13 +50,14 @@ try {
|
|
|
48
50
|
|
|
49
51
|
const effectiveRefs=referenceRoot({defaultRefsDir:settings.paths.refs});
|
|
50
52
|
if(settings.autoSyncSkills&&!options.dry&&['style','generate','edit'].includes(module)&&['analyze','adopt','run'].includes(action)){try{autoSync();}catch(error){console.error('skill 自动同步失败:'+error.message+';可用 agent init 重试。');}}
|
|
51
|
-
if(module==='
|
|
52
|
-
if(action==='
|
|
53
|
-
else if(action==='
|
|
54
|
-
else if(action==='
|
|
55
|
-
else if(action==='
|
|
56
|
-
else if(action==='
|
|
57
|
-
else
|
|
53
|
+
if(module==='environment'){
|
|
54
|
+
if(action==='guide')print(deploymentGuide(options.guide));
|
|
55
|
+
else if(action==='list')print({environments:discoverInstallations()});
|
|
56
|
+
else if(action==='inspect')print(await inspectInstallation(required('directory'),required('endpoint'),options.guide));
|
|
57
|
+
else if(action==='verify'){const result=await verifyInstallation(required('directory'),required('endpoint'),{guideId:options.guide});print(result);if(!result.ok)process.exitCode=1;}
|
|
58
|
+
else if(action==='register')print(await registerInstallation(required('directory'),required('endpoint'),{guideId:options.guide}));
|
|
59
|
+
else if(action==='unregister')print(await unregisterInstallation(required('directory')));
|
|
60
|
+
else throw new Error('未知 environment 操作');
|
|
58
61
|
}
|
|
59
62
|
else if(module==='config'){
|
|
60
63
|
if(action==='path') console.log(settings.file);
|
|
@@ -99,6 +102,12 @@ try {
|
|
|
99
102
|
else throw new Error('未知 agent 操作');
|
|
100
103
|
}
|
|
101
104
|
else if(module==='list'){print((existsSync(join(ROOT,'projects'))?readdirSync(join(ROOT,'projects')):[]).map(id=>readJson(join(ROOT,'projects',id,'project.json'))));}
|
|
105
|
+
else if(module==='style'&&['export','import','sources'].includes(action)){
|
|
106
|
+
const bundle=await import('./lib/style-bundle.mjs');
|
|
107
|
+
if(action==='export')print(bundle.exportStyleBundle(ROOT,required('project'),required('id'),path(required('out'))));
|
|
108
|
+
else if(action==='import')print(await bundle.importStyleBundle(settings,required('project'),path(required('file'))));
|
|
109
|
+
else print(bundle.listStyleSources(readJson(path(required('input')))));
|
|
110
|
+
}
|
|
102
111
|
else if(module==='style'){
|
|
103
112
|
const projectId=required('project');
|
|
104
113
|
if(action==='analyze')print(await startAnalysis(settings,projectId,required('id'),Number(required('revision')),{dry:options.dry,operationId:options.operation}));
|
package/docs/commands.md
CHANGED
|
@@ -830,111 +830,164 @@ v-cli art reference update --project P --kind style --id ID --revision N --item
|
|
|
830
830
|
|
|
831
831
|
- 冻结风格只读;任务不允许静态分类;不修改用户原图;旧证据保留
|
|
832
832
|
|
|
833
|
-
###
|
|
833
|
+
### job template
|
|
834
834
|
|
|
835
|
-
|
|
835
|
+
只读返回工具权威的任务配置模板;生成任务使用已冻结核心的题材
|
|
836
836
|
|
|
837
837
|
```sh
|
|
838
|
-
v-cli art
|
|
838
|
+
v-cli art job template --project <id> --kind <generate|edit> [--core <id>]
|
|
839
839
|
```
|
|
840
840
|
|
|
841
|
-
- `--
|
|
842
|
-
- `--
|
|
843
|
-
- `--
|
|
841
|
+
- `--project <id>`:工程身份
|
|
842
|
+
- `--kind <generate|edit>`:任务类型
|
|
843
|
+
- `--core <id>`:生成任务的冻结核心身份
|
|
844
844
|
|
|
845
|
-
-
|
|
845
|
+
- 只读返回模板;不创建任务或文件
|
|
846
846
|
|
|
847
|
-
###
|
|
847
|
+
### job from-candidate
|
|
848
848
|
|
|
849
|
-
|
|
849
|
+
将完整候选导入私有底图,创建独立编辑草稿,不运行
|
|
850
850
|
|
|
851
851
|
```sh
|
|
852
|
-
v-cli art
|
|
852
|
+
v-cli art job from-candidate --project <id> --id <task> --run <id> --candidate <id>
|
|
853
853
|
```
|
|
854
854
|
|
|
855
|
-
- `--
|
|
856
|
-
- `--
|
|
855
|
+
- `--project <id>`:工程身份
|
|
856
|
+
- `--id <task>`:源任务身份
|
|
857
|
+
- `--run <id>`:真实批次
|
|
858
|
+
- `--candidate <id>`:完整候选身份
|
|
857
859
|
|
|
858
|
-
-
|
|
860
|
+
- 写入新的编辑草稿和私有底图;保留候选来源;不启动生成
|
|
859
861
|
|
|
860
|
-
###
|
|
862
|
+
### task resume
|
|
861
863
|
|
|
862
|
-
|
|
864
|
+
仅恢复原上游任务的查询和下载,绝不重新提交
|
|
863
865
|
|
|
864
866
|
```sh
|
|
865
|
-
v-cli art
|
|
867
|
+
v-cli art task resume TASK
|
|
866
868
|
```
|
|
867
869
|
|
|
868
|
-
-
|
|
870
|
+
- 位置参数 `TASK`:art 任务 ID(必填)
|
|
869
871
|
|
|
870
|
-
-
|
|
872
|
+
- 写入原任务状态
|
|
873
|
+
- 查询原上游任务并下载已有产物
|
|
874
|
+
- 提交结果未知时拒绝恢复
|
|
871
875
|
|
|
872
|
-
###
|
|
876
|
+
### environment guide
|
|
873
877
|
|
|
874
|
-
|
|
878
|
+
本地环境部署指南
|
|
875
879
|
|
|
876
880
|
```sh
|
|
877
|
-
v-cli art
|
|
881
|
+
v-cli art environment guide
|
|
878
882
|
```
|
|
879
883
|
|
|
880
|
-
- `--
|
|
884
|
+
- `--guide <id>`:部署指南标识;省略使用环境登记或推荐方案
|
|
881
885
|
|
|
882
|
-
-
|
|
886
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
883
887
|
|
|
884
|
-
###
|
|
888
|
+
### environment list
|
|
885
889
|
|
|
886
|
-
|
|
890
|
+
本地环境目录发现
|
|
887
891
|
|
|
888
892
|
```sh
|
|
889
|
-
v-cli art
|
|
893
|
+
v-cli art environment list
|
|
890
894
|
```
|
|
891
895
|
|
|
892
|
-
- `--operation <id>`:启动前登记的稳定身份
|
|
893
896
|
|
|
894
|
-
-
|
|
897
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
895
898
|
|
|
896
|
-
###
|
|
899
|
+
### environment inspect
|
|
897
900
|
|
|
898
|
-
|
|
901
|
+
本地环境只读检测
|
|
899
902
|
|
|
900
903
|
```sh
|
|
901
|
-
v-cli art
|
|
904
|
+
v-cli art environment inspect
|
|
902
905
|
```
|
|
903
906
|
|
|
904
|
-
- `--
|
|
905
|
-
- `--
|
|
906
|
-
- `--
|
|
907
|
+
- `--directory <value>`:本机环境根目录
|
|
908
|
+
- `--endpoint <value>`:本机 HTTP 服务根地址
|
|
909
|
+
- `--guide <id>`:部署指南标识;省略使用环境登记或推荐方案
|
|
907
910
|
|
|
908
|
-
-
|
|
911
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
909
912
|
|
|
910
|
-
###
|
|
913
|
+
### environment verify
|
|
911
914
|
|
|
912
|
-
|
|
915
|
+
本地环境确定性验收
|
|
913
916
|
|
|
914
917
|
```sh
|
|
915
|
-
v-cli art
|
|
918
|
+
v-cli art environment verify
|
|
916
919
|
```
|
|
917
920
|
|
|
918
|
-
- `--
|
|
919
|
-
- `--
|
|
920
|
-
- `--
|
|
921
|
-
- `--candidate <id>`:完整候选身份
|
|
921
|
+
- `--directory <value>`:本机环境根目录
|
|
922
|
+
- `--endpoint <value>`:本机 HTTP 服务根地址
|
|
923
|
+
- `--guide <id>`:部署指南标识;省略使用环境登记或推荐方案
|
|
922
924
|
|
|
923
|
-
-
|
|
925
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
924
926
|
|
|
925
|
-
###
|
|
927
|
+
### environment register
|
|
926
928
|
|
|
927
|
-
|
|
929
|
+
本地环境验收并登记
|
|
928
930
|
|
|
929
931
|
```sh
|
|
930
|
-
v-cli art
|
|
932
|
+
v-cli art environment register
|
|
931
933
|
```
|
|
932
934
|
|
|
933
|
-
-
|
|
935
|
+
- `--directory <value>`:本机环境根目录
|
|
936
|
+
- `--endpoint <value>`:本机 HTTP 服务根地址
|
|
937
|
+
- `--guide <id>`:部署指南标识;省略使用环境登记或推荐方案
|
|
934
938
|
|
|
935
|
-
-
|
|
936
|
-
|
|
937
|
-
|
|
939
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
940
|
+
|
|
941
|
+
### environment unregister
|
|
942
|
+
|
|
943
|
+
本地环境解除登记
|
|
944
|
+
|
|
945
|
+
```sh
|
|
946
|
+
v-cli art environment unregister
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
- `--directory <value>`:本机环境根目录
|
|
950
|
+
|
|
951
|
+
- 不执行安装、下载或采样;register 重新验收后登记,unregister 不删除安装文件或停止服务
|
|
952
|
+
|
|
953
|
+
### style export
|
|
954
|
+
|
|
955
|
+
导出冻结风格及必要参考,不复制运行状态
|
|
956
|
+
|
|
957
|
+
```sh
|
|
958
|
+
v-cli art style export
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
- `--project <value>`:工程身份
|
|
962
|
+
- `--id <value>`:冻结风格身份
|
|
963
|
+
- `--out <value>`:风格包输出文件
|
|
964
|
+
|
|
965
|
+
- 冻结风格包只读;不覆盖已有文件;修改请派生草稿;只导出明确引用的参考图片
|
|
966
|
+
|
|
967
|
+
### style import
|
|
968
|
+
|
|
969
|
+
导入固定版本的共享冻结风格,保留原身份和版本
|
|
970
|
+
|
|
971
|
+
```sh
|
|
972
|
+
v-cli art style import
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
- `--project <value>`:目标工程
|
|
976
|
+
- `--file <value>`:风格包文件
|
|
977
|
+
|
|
978
|
+
- 冻结风格包只读;不覆盖已有文件;修改请派生草稿;只导出明确引用的参考图片
|
|
979
|
+
|
|
980
|
+
### style sources
|
|
981
|
+
|
|
982
|
+
只读列出多个冻结风格来源并报告不可用目录和身份冲突
|
|
983
|
+
|
|
984
|
+
```sh
|
|
985
|
+
v-cli art style sources
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
- `--input <value>`:来源目录列表 JSON 文件
|
|
989
|
+
|
|
990
|
+
- 冻结风格包只读;不覆盖已有文件;修改请派生草稿;只导出明确引用的参考图片
|
|
938
991
|
|
|
939
992
|
## 结果验证
|
|
940
993
|
|
package/docs/deployment.md
CHANGED
|
@@ -1,60 +1,32 @@
|
|
|
1
|
-
# Vant
|
|
1
|
+
# Vant 本地模型部署
|
|
2
2
|
|
|
3
3
|
## 定位
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
部署指南由 art 维护;Pi 根据机器环境规划并执行安装,Harness 管理授权、进程、停止与恢复。工具负责环境检测、模型校验和登记。
|
|
6
6
|
|
|
7
7
|
## 前置条件
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
配置可用聊天模型,选择项目和本机安装目录、回环服务地址。任务授权覆盖目录内安装、下载及验证采样;已有文件冲突时保留原文件。推荐方案、依赖版本和模型校验值由 environment guide 返回。
|
|
10
10
|
|
|
11
11
|
## 操作流程
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
1. `v-cli art environment guide` 读取指南与模型契约。
|
|
14
|
+
2. `v-cli art environment list` 发现已有环境;`environment inspect --directory DIR --endpoint URL` 检测指定环境。
|
|
15
|
+
3. Pi 使用基础工具与动态工作流完成运行时、节点、依赖、模型和服务配置。网络或命令失败根据实际错误修正,保留成功节点。
|
|
16
|
+
4. `environment verify --directory DIR --endpoint URL` 校验文件 SHA256、服务身份和工作流能力;本命令不下载、启动服务或采样。
|
|
17
|
+
5. 通过标准计划与任务命令验证生成、编辑;保留原 taskId,不重发未知请求。
|
|
18
|
+
6. `environment register --directory DIR --endpoint URL` 重新验收后登记。Vant 部署会话通过 art_operation 调用 environment-register,回填系统目录与地址。
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
服务需长期运行时使用配置 launch 的 `doctor --start`,由 art 保存归属并在 Vant 退出时清理;普通下载与安装命令使用 Harness 受管进程。
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
空目录输入时,组织层可用 discoverInstallations 读取环境索引,并在默认目录、用户 AI 目录及 Windows C:/AI、D:/AI、E:/AI 有界扫描环境标记和 ComfyUI。扫描有深度和数量预算,不是全盘检索。独立 CLI deployment plan 必须明确 --directory,不会自行执行界面的自动选择逻辑。
|
|
20
|
-
|
|
21
|
-
端口自动选择只证明检测时可绑定,不预约端口。目录或端口变更后重新检测,确认的地址随环境保存;实际启动仍可能因端口被其他程序占用而失败。不能把其他进程监听同一端口视为此目录的环境。
|
|
22
|
-
|
|
23
|
-
### 已有环境复用
|
|
24
|
-
|
|
25
|
-
1. 检查 Python、ComfyUI、GGUF 节点、固定模型文件及大小,检查生成与编辑工作流的实际节点能力和端口归属。
|
|
26
|
-
2. 对可复用但未登记环境,adoptInstallation 流式验证模型 SHA256,连接或启动对应服务,核验能力后写入标记及用户环境索引。保留原模型;不因未登记而再次下载整套环境。
|
|
27
|
-
3. 接入检测的 verification=capabilities 只代表环境和工作流能力验证。新部署产生的真实生成、编辑验证图是另一等级证据,不能混称。
|
|
28
|
-
4. 缺文件或版本不符时展示具体差异。固定部署不自动覆写不匹配源码、模型或用户安装;先明确处理差异,再生成新预案。
|
|
29
|
-
|
|
30
|
-
### 独立 CLI 流程
|
|
31
|
-
|
|
32
|
-
以下示例使用已核对的安装目录与端口;启动前必须有部署、下载及验证采样的任务授权。
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
v-cli art deployment plan --directory C:/AI/ComfyUI_windows_portable --endpoint http://127.0.0.1:8188/ --out deployment.json
|
|
36
|
-
v-cli art deployment start --plan deployment.json --operation local-deploy-001
|
|
37
|
-
v-cli art deployment status --id DEPLOYMENT
|
|
38
|
-
v-cli art deployment cancel --id DEPLOYMENT
|
|
39
|
-
v-cli art deployment recover --operation local-deploy-001
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
plan 检测 Git、GPU、Python、文件与磁盘;需要下载模型时同时检测 curl.exe。不下载、不启动服务、不采样;现有文件存在不等于哈希已验证。Git 需能在 Vant 的 PATH 中直接执行,安装 Git for Windows 或修改 PATH 后须完全退出并重新启动 Vant。start 和工作进程执行前再次复核依赖与冻结预案;源码克隆前创建临时工作目录,完成固定提交检出后才提交源码。缺少命令与工作目录不可用分别报告,不再统一显示 ENOENT。
|
|
43
|
-
|
|
44
|
-
start 创建后台 deploymentId,逐阶段记录实际进度,按固定方案安装、校验、生成与编辑采样;完成后才提交配置。下载或校验失败不覆写既有冲突文件。
|
|
45
|
-
|
|
46
|
-
status 查询原部署。cancel 只停止已核验的本部署进程与采样,不删除用户素材或原模型,不关闭用户先前启动的服务。recover 只找回唯一原登记,不重复安装。工作进程丢失或停止未确认时保留 unknown 与安装占用。
|
|
47
|
-
|
|
48
|
-
### 存储与关闭
|
|
49
|
-
|
|
50
|
-
安装根保存程序、模型和 vant.art.config.json;环境索引、受管服务身份、日志和验证证据归 ~/.vant/state。项目生图归工程绑定的 .vant/art,不能写入共享模型环境。
|
|
51
|
-
|
|
52
|
-
Vant 退出使用其应用生命周期清理关联后台任务,并关闭可核验为 Vant 启动的 ComfyUI,确认本机端口释放。单独关闭部署窗口不取消部署。CLI shutdown 的工作区与共享服务边界见 [任务控制](troubleshooting.md)。
|
|
22
|
+
`environment unregister --directory DIR` 仅解除登记,不删除安装文件和模型,也不停止外部服务。
|
|
53
23
|
|
|
54
24
|
## 结果验证
|
|
55
25
|
|
|
56
|
-
|
|
26
|
+
文件、服务、节点能力与真实采样分别记录。登记的 verification=capabilities 和 sampleVerified=false 表示未以此次登记证明真实出图。模型回复不能替代工具验收。
|
|
27
|
+
|
|
28
|
+
取消由工作流停止入口处理;普通插话和关闭设置页不终止部署。恢复先核对任务记录、原进程及实际文件,保留有效下载,不重新执行成功节点。未知副作用继续占用,不能当作已停止。
|
|
57
29
|
|
|
58
30
|
## 参考资料
|
|
59
31
|
|
|
60
|
-
[使用说明](../README.md)
|
|
32
|
+
[部署指南](local-models/qwen-image-2.1.md) · [使用说明](../README.md)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "qwen-image-2.1-Q4-cpu-text-v1",
|
|
3
|
+
"comfy": {
|
|
4
|
+
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
|
5
|
+
"commit": "b0b743566f65daafc423b4fea8a2fbda94b3384a"
|
|
6
|
+
},
|
|
7
|
+
"plugin": {
|
|
8
|
+
"repository": "https://github.com/leejet/ComfyUI-GGUF",
|
|
9
|
+
"commit": "373048b8403a7820620065210a691263d4da0a61"
|
|
10
|
+
},
|
|
11
|
+
"models": [
|
|
12
|
+
{
|
|
13
|
+
"path": "diffusion_models/qwen-image-2.1-UC-Q4_K_M.gguf",
|
|
14
|
+
"bytes": 4604558112,
|
|
15
|
+
"url": "https://huggingface.co/abenzerps/Qwen-Image-2.1-Uncensored-GGUF/resolve/main/qwen-image-2.1-UC-Q4_K_M.gguf",
|
|
16
|
+
"sha256": "e79c8a009f2ecbdb6c70fd663d9aea9ee304a0d91f347e4169a756b8ad141b41"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "text_encoders/qwen3vl_8b_int8_convrot.safetensors",
|
|
20
|
+
"bytes": 9350798360,
|
|
21
|
+
"url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors",
|
|
22
|
+
"sha256": "8bfd0f6e12abf2d2d697ecc888e5e90b0d6741d6708f05799f53afa560452e8f"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "vae/qwen_image_2.1_vae_bf16.safetensors",
|
|
26
|
+
"bytes": 675509688,
|
|
27
|
+
"url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors",
|
|
28
|
+
"sha256": "bb21f7473051e1ac368515dd3f2e15cd44d7a11748ee8823e1ddca3e4876b7c9"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"torch": "2.14.0",
|
|
32
|
+
"torchvision": "0.29.0",
|
|
33
|
+
"torchIndex": "https://download.pytorch.org/whl/cu130",
|
|
34
|
+
"gguf": "0.19.0",
|
|
35
|
+
"backend": {
|
|
36
|
+
"provider": "comfyui",
|
|
37
|
+
"model": "qwen-image-2.1-UC-Q4_K_M.gguf",
|
|
38
|
+
"workflow": "vant-builtin-qwen-image-2.1-Q4-8GB"
|
|
39
|
+
},
|
|
40
|
+
"pythonCandidates": [
|
|
41
|
+
"python_embeded/python.exe",
|
|
42
|
+
".venv/Scripts/python.exe"
|
|
43
|
+
],
|
|
44
|
+
"launchArgs": [
|
|
45
|
+
"-s",
|
|
46
|
+
"ComfyUI/main.py",
|
|
47
|
+
"--disable-dynamic-vram",
|
|
48
|
+
"--lowvram",
|
|
49
|
+
"--disable-auto-launch"
|
|
50
|
+
],
|
|
51
|
+
"requiredPaths": [
|
|
52
|
+
"ComfyUI/main.py",
|
|
53
|
+
"ComfyUI/custom_nodes/ComfyUI-GGUF"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Vant 本地图片模型部署指南
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
在用户指定目录部署或复用 ComfyUI 环境,接入 Qwen Image 2.1 Q4 图片生成及编辑。模型文件、固定版本与校验值读取同目录 JSON 契约,不猜测版本。根据实际系统、显卡、磁盘和网络制定命令;执行前明确任务范围。
|
|
6
|
+
|
|
7
|
+
## 检测
|
|
8
|
+
|
|
9
|
+
先读取 art environment guide,检测系统、GPU/显存、驱动、内存、磁盘、Git、Python、下载工具、端口以及已有环境。优先复用用户指定目录或 art 环境索引;不全盘扫描。没有 Git 可选择发行包下载,不重复执行失败命令。用户已有源码、虚拟环境和模型不直接覆盖。
|
|
10
|
+
|
|
11
|
+
## 执行
|
|
12
|
+
|
|
13
|
+
使用 Pi 基础工具与 Harness 受管进程执行。创建动态工作流,节点为检查环境、准备运行时、安装依赖、下载模型、配置服务、验证能力、登记环境。命令、错误和产物保存到任务记录。按实际反馈修正当前节点,成功节点不重复执行。
|
|
14
|
+
|
|
15
|
+
在目标目录创建独立 Python 环境,或复用经过检测的便携 Python。源码检出契约指定提交,依赖安装在该 Python 环境。按模型契约将文件下载到 ComfyUI/models 下,先写临时文件,校验 SHA256 后改为最终文件;保留有效文件并支持续传。网络失败时检查已有代理,仅在当前命令使用,不修改系统代理。不自行安装或更新全局 npm 工具。
|
|
16
|
+
|
|
17
|
+
低显存方案将文本编码器放在 CPU,服务使用 --disable-dynamic-vram --lowvram --disable-auto-launch。不要承诺显存一定充足。服务仅监听回环地址。端口占用时核对服务身份,不能将另一套环境误登记为当前目录。
|
|
18
|
+
|
|
19
|
+
## 验收
|
|
20
|
+
|
|
21
|
+
分别记录文件校验、服务连通、节点/工作流能力和真实采样。使用 art environment verify 对当前目录和端口验收;验收失败按原始错误修正。真实生成和编辑通过 art 的计划及任务机制执行,保存原 taskId,不重复提交未知请求。只有实际图像及完成回执能够证明采样成功。
|
|
22
|
+
|
|
23
|
+
使用 art environment register 重新核验并登记已通过能力检查的环境。能力验收不等于采样验证;缺少真实采样时明确展示。登记完成再更新 Vant 的本地环境设置。
|
|
24
|
+
|
|
25
|
+
## 取消与恢复
|
|
26
|
+
|
|
27
|
+
用户普通插话不终止工作流。工作流停止时等待本任务进程实际退出,保留已校验模型、已有用户文件与执行证据。只停止能够核验身份的本任务服务,不能杀全部 Python 或关闭用户原有服务。恢复时先读任务记录、检查原进程与文件;未知副作用先核实,不重跑整个安装。关闭部署窗口不取消任务。
|
|
28
|
+
|
|
29
|
+
## 版权
|
|
30
|
+
|
|
31
|
+
Copyright © 2026 Vant。
|
package/lib/agent.mjs
CHANGED
|
@@ -39,7 +39,7 @@ export function autoSync({root=ROOT,cwd=process.cwd(),home=homedir(),env=process
|
|
|
39
39
|
return syncSkill({root,skillDirs:dirs});
|
|
40
40
|
}
|
|
41
41
|
export function agentIndex(root=ROOT,workspace=loadSettings().paths.workspace) {
|
|
42
|
-
return {tool:'art-workshop',displayName:'美术工坊',root,workspace,config:loadSettings().file,entry:join(root,'art-workshop.mjs'),skill:{name:'art-workshop',source:join(root,'skills','art-workshop','SKILL.md'),automaticDiscovery:true},modules:[{name:'style',actions:['create','list','read','update','derive','discard','analyze','resolve','adopt','recover','validate','show']},{name:'generate',actions:['show','plan','run']},{name:'edit',actions:['show','plan','run']},{name:'refs',actions:['guide']},{name:'agent',actions:['index','docs','init']}],utilities:['project','job','reference','candidate','list','check','compare','task','shutdown','doctor','workflow','config'],projects:(directory(join(workspace,'projects'))?readdirSync(join(workspace,'projects')):[]).filter(id=>directory(join(workspace,'projects',id))).map(id=>{const p=loadProject(id,workspace);return {id:p.id,cores:p.cores,defaultCore:p.defaultCore,jobs:readdirSync(join(workspace,'projects',id,'tasks')).filter(x=>existsSync(join(workspace,'projects',id,'tasks',x,'task.json')))};})};
|
|
42
|
+
return {tool:'art-workshop',displayName:'美术工坊',root,workspace,config:loadSettings().file,entry:join(root,'art-workshop.mjs'),skill:{name:'art-workshop',source:join(root,'skills','art-workshop','SKILL.md'),automaticDiscovery:true},modules:[{name:'style',actions:['create','list','read','update','derive','discard','analyze','resolve','adopt','recover','validate','show']},{name:'generate',actions:['show','plan','run']},{name:'edit',actions:['show','plan','run']},{name:'refs',actions:['guide']},{name:'agent',actions:['index','docs','init']}],utilities:['environment','project','job','reference','candidate','list','check','compare','task','shutdown','doctor','workflow','config'],projects:(directory(join(workspace,'projects'))?readdirSync(join(workspace,'projects')):[]).filter(id=>directory(join(workspace,'projects',id))).map(id=>{const p=loadProject(id,workspace);return {id:p.id,cores:p.cores,defaultCore:p.defaultCore,jobs:readdirSync(join(workspace,'projects',id,'tasks')).filter(x=>existsSync(join(workspace,'projects',id,'tasks',x,'task.json')))};})};
|
|
43
43
|
}
|
|
44
44
|
export const GUIDE_FILES=['README.md','docs/modes.md','docs/configuration.md','docs/data-formats.md','docs/commands.md','docs/deployment.md','docs/troubleshooting.md','docs/remote-models.md','docs/model-architecture.md','docs/core-guidance.md'];
|
|
45
45
|
export function agentDocs(root=ROOT) {return GUIDE_FILES.map(file=>readFileSync(join(root,file),'utf8')).join('\n\n');}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {readFileSync,readdirSync} from 'node:fs';
|
|
2
|
+
import {fileURLToPath} from 'node:url';
|
|
3
|
+
const root=new URL('../docs/local-models/',import.meta.url);
|
|
4
|
+
export function deploymentGuide(id){
|
|
5
|
+
const entries=readdirSync(root).filter(name=>name.endsWith('.json')).map(name=>({name,contract:JSON.parse(readFileSync(new URL(name,root),'utf8'))}));
|
|
6
|
+
const selected=id?entries.find(entry=>entry.contract.id===id):entries.find(entry=>entry.name==='qwen-image-2.1.json');
|
|
7
|
+
if(!selected)throw new Error('未知部署指南 '+id);
|
|
8
|
+
if(selected.contract.backend.workflow && !selected.contract.backend.workflow.startsWith('vant-builtin-'))selected.contract.backend.workflow=fileURLToPath(new URL(selected.contract.backend.workflow,root));
|
|
9
|
+
return {schema:'art-workshop/deployment-guide',id:selected.contract.id,contract:selected.contract,
|
|
10
|
+
available:entries.map(entry=>({id:entry.contract.id,model:entry.contract.backend.model})),
|
|
11
|
+
instructions:readFileSync(new URL(selected.name.replace(/\.json$/,'.md'),root),'utf8'),directory:fileURLToPath(root)};
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {createHash} from 'node:crypto';
|
|
2
|
+
import {createReadStream,realpathSync,existsSync,readFileSync,rmSync} from 'node:fs';
|
|
3
|
+
import {join} from 'node:path';
|
|
4
|
+
import {deploymentGuide} from './deployment-guide.mjs';
|
|
5
|
+
import {inspectInstallation,writeMarker,environmentRoot,MARKER} from './environments.mjs';
|
|
6
|
+
import {locked} from './runtime.mjs';
|
|
7
|
+
|
|
8
|
+
export async function verifyInstallation(directory,endpoint,{cancelled=()=>false,guideId}={}){
|
|
9
|
+
const report=await inspectInstallation(directory,endpoint,guideId);
|
|
10
|
+
const issues=[...report.missing,...(report.conflict?[report.conflict]:[])];
|
|
11
|
+
if(report.markerError)issues.push(report.markerError);
|
|
12
|
+
if(!report.live)issues.push('服务与工作流能力尚未通过');
|
|
13
|
+
for(const model of deploymentGuide(report.guideId).contract.models){
|
|
14
|
+
const file=join(report.root,'ComfyUI/models',model.path);
|
|
15
|
+
if(!existsSync(file))continue;
|
|
16
|
+
const digest=createHash('sha256');
|
|
17
|
+
for await(const chunk of createReadStream(file)){
|
|
18
|
+
if(cancelled())throw new Error('环境验收已取消');
|
|
19
|
+
digest.update(chunk);
|
|
20
|
+
}
|
|
21
|
+
if(digest.digest('hex')!==model.sha256)issues.push('SHA256 不匹配:'+model.path);
|
|
22
|
+
}
|
|
23
|
+
return {...report,ok:issues.length===0,issues,verification:'capabilities',sampleVerified:false,checkedAt:new Date().toISOString()};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function registerInstallation(directory,endpoint,{guideId}={}){
|
|
27
|
+
const root=realpathSync(directory);
|
|
28
|
+
return locked(environmentRoot(root),'registration',async()=>{
|
|
29
|
+
const report=await verifyInstallation(root,endpoint,{guideId});
|
|
30
|
+
if(!report.ok)throw new Error('环境验收未通过:'+report.issues.join(';'));
|
|
31
|
+
const record=writeMarker(root,{python:report.python,endpoint,recipe:report.guideId,verification:'capabilities'});
|
|
32
|
+
return {ok:true,root,...record,sampleVerified:false};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function unregisterInstallation(directory){
|
|
37
|
+
const root=realpathSync(directory);
|
|
38
|
+
return locked(environmentRoot(root),'registration',async()=>{
|
|
39
|
+
const file=join(environmentRoot(root),'environment.json');
|
|
40
|
+
if(!existsSync(file))throw new Error('环境未登记');
|
|
41
|
+
const record=JSON.parse(readFileSync(file,'utf8'));
|
|
42
|
+
if(record.root!==root)throw new Error('环境登记身份不匹配');
|
|
43
|
+
// Only registry records are removed; installation and service remain untouched.
|
|
44
|
+
rmSync(file);
|
|
45
|
+
const marker=join(root,MARKER);
|
|
46
|
+
if(existsSync(marker)&&JSON.parse(readFileSync(marker,'utf8')).environmentId===record.environmentId)rmSync(marker);
|
|
47
|
+
return {ok:true,root};
|
|
48
|
+
});
|
|
49
|
+
}
|