CanvasCraftSFT
收藏资源简介:
CanvasCraftSFT是CanvasCraft数据集的监督微调子集,源自CanvasAgent研究,旨在为复杂图像创建和编辑任务提供可执行的多模态工具使用轨迹。该数据集包含142,798个轨迹示例,每个轨迹教导代理如何响应用户请求、调用带有结构化参数的视觉工具、观察中间视觉结果,并决定图像转换何时完成。数据以JSON格式存储轨迹(包括任务提示、图像列表、元数据和聊天式消息序列),并以Parquet分片形式嵌入181,038个图像资源(对应179,630个唯一图像路径)。轨迹中图像引用数量分布广泛(1-7个图像),消息长度主要为5-19条,工具使用涵盖图像编辑、生成、OCR、定位、翻转、旋转、超分辨率等51种独特工具链。该数据集专为多模态工具使用代理的监督微调研究而设计,适用于图像创建和编辑工作流、视觉代理的推理-动作-观察训练,以及为在CanvasCraftRL上进行强化学习前的代理引导。数据仅限研究和教育用途,需注意轨迹JSON中使用遗留绝对图像前缀,需规范化路径以匹配存储库文件。
CanvasCraftSFT is a supervised fine-tuning subset of the CanvasCraft dataset, derived from CanvasAgent research, designed to provide executable multimodal tool usage trajectories for complex image creation and editing tasks. The dataset contains 142,798 trajectory examples, each teaching an agent how to respond to user requests, invoke visual tools with structured parameters, observe intermediate visual results, and decide when image transformations are complete. Data is stored in JSON format for trajectories (including task prompts, image lists, metadata, and chat-style message sequences), with 181,038 image resources embedded in Parquet shards (corresponding to 179,630 unique image paths). Trajectories have a wide distribution of image references (1-7 images), message lengths primarily between 5-19, and tool usage covers 51 unique tool chains such as image editing, generation, OCR, positioning, flipping, rotation, and super-resolution. This dataset is specifically designed for supervised fine-tuning research on multimodal tool-using agents, applicable to image creation and editing workflows, reasoning-action-observation training for visual agents, and agent bootstrapping before reinforcement learning on CanvasCraftRL. Data is limited to research and educational use; note that legacy absolute image prefixes are used in trajectory JSONs, requiring path normalization to match repository files.
CanvasCraftSFT 数据集概述
CanvasCraftSFT 是 CanvasCraft 数据集的监督微调子集,与 CanvasAgent: Enabling Complex Image Creation and Editing via Visual Tool Orchestration 一同发布。该数据集包含用于复杂图像创建和编辑任务的可执行多模态工具使用轨迹。
数据集用途
- 研究目的:仅限研究及教育用途,禁止商业使用。
- 主要目标:为 CanvasAgent 提供 SFT(监督微调)阶段训练数据,后续结合 CanvasCraftRL 进行强化学习。
- 适用研究方向:
- 多模态工具使用代理的监督微调
- 图像创建与编辑工作流中的可执行工具调用
- 视觉代理的推理-行动-观察训练
- 多轮交互中的视觉资产追踪
- 为 CanvasCraftRL 强化学习优化进行代理预训练
数据集统计
主轨迹文件:train_reason_imglist.json,包含 142,798 条记录。
图像资源:
| 资源 | 数量 |
|---|---|
| Parquet 图像分片数 | 167 |
| Parquet 中嵌入的图像行数 | 181,038 |
| 唯一图像路径 | 179,630 |
轨迹图像引用分布:
| 每轨迹图像数 | 示例数 |
|---|---|
| 1 | 49,972 |
| 2 | 71,069 |
| 3 | 19,270 |
| 4 | 1,883 |
| 5 | 540 |
| 6 | 61 |
| 7 | 3 |
对话长度分布:
| 每轨迹消息数 | 示例数 |
|---|---|
| 5 | 98,811 |
| 7 | 26,786 |
| 9 | 13,393 |
| 11 | 2,045 |
| 13 | 1,154 |
| 15 | 594 |
| 17 | 12 |
| 19 | 3 |
工具使用分布:
| 工具或工具链 | 示例数 |
|---|---|
ImageEdit |
19,378 |
ImageGeneration |
18,616 |
OCR |
17,876 |
Grounding |
13,480 |
Grounding+Crop |
13,393 |
Grounding+SAM |
13,393 |
Grounding+SAM+Extract |
13,393 |
Overlayer |
10,000 |
Flip |
8,834 |
Rotate |
8,627 |
SR |
2,000 |
| 多工具链(51 种不同链) | 3,808 |
数据格式
SFT 轨迹:train_reason_imglist.json 是一个 JSON 数组,每条记录包含以下字段:
| 字段 | 描述 |
|---|---|
prompt |
自然语言用户请求 |
edit_type |
可用的编辑类别 |
images |
轨迹使用的图像路径列表(使用旧版绝对路径前缀) |
extra_info |
元数据,如 original_id、轮次信息、工具名称或工具链 |
messages |
聊天风格的 SFT 对话,包括系统提示、用户提示、助手推理/工具调用、工具观察结果和最终助手回复 |
image_size、bbox、ocr_tokens |
可选的特定任务元数据,用于定位和 OCR 相关子集 |
messages 字段遵循工具使用格式,助手消息中可能包含 <reason>...</reason><tool_call>{"name": "...", "arguments": {...}}</tool_call> 等标记。工具观察结果存储为 role="tool" 的消息,可能包含 <image> 标记指示新生成的视觉资产。
图像包:以 Parquet 分片形式存储,具有以下模式:
image:struct<bytes: binary, path: string>,标记为 Hugging FaceImage特征,可直接由datasets解码。path:字符串类型,原始相对路径。
167 个分片包括 151 个原始图像分片、7 个 SR 图像分片和 9 个与 3,808 条新增多工具轨迹相关的分片。某些图像路径在多个行中出现,需使用 path 列作为查找键。
数据加载示例
加载轨迹 JSON: python from datasets import load_dataset repo_id = "GML-FMGroup/CanvasCraftSFT" traj = load_dataset("json", data_files={"train": f"hf://datasets/{repo_id}/train_reason_imglist.json"}, split="train", streaming=True) example = next(iter(traj)) print(example["prompt"]) print(example["images"]) print(example["messages"][-1]["content"])
加载嵌入图像包: python from datasets import load_dataset repo_id = "GML-FMGroup/CanvasCraftSFT" images = load_dataset("parquet", data_files={"train": f"hf://datasets/{repo_id}/data/train-*.parquet"}, split="train", streaming=True) sample = next(iter(images)) print(sample["path"]) print(sample["image"].size)
构建路径到图像的查找表(本地使用): python from datasets import load_dataset repo_id = "GML-FMGroup/CanvasCraftSFT" def normalize_path(path: str) -> str: return path.removeprefix("/jiangwenhao/zhuhairui/").lstrip("/") images = load_dataset("parquet", data_files={"train": f"hf://datasets/{repo_id}/data/train-*.parquet"}, split="train", streaming=True) image_by_path = {} for row in images: image_by_path[row["path"]] = row["image"] traj = load_dataset("json", data_files={"train": f"hf://datasets/{repo_id}/train_reason_imglist.json"}, split="train", streaming=True) record = next(iter(traj)) resolved_paths = [normalize_path(path) for path in record["images"]] resolved_images = [image_by_path.get(path) for path in resolved_paths]
已知局限性
- 轨迹 JSON 使用旧版绝对图像前缀,需移除
/jiangwenhao/zhuhairui/以匹配仓库文件。 original_id在当前合并文件中唯一,但不等于数组索引。- 所有引用的图像路径(包括 SR 输出和多工具中间结果)均嵌入在 Parquet 图像包中。
- 数据集反映固定工具环境,工具模式、模型后端和视觉输出可能因其他实现而异。
- 数据仅供研究使用,用户应避免欺骗性、有害、侵犯隐私或误导性的视觉内容应用。
引用
若使用该数据集,请引用 CanvasAgent / CanvasCraft 论文: bibtex @misc{canvasagent2026, title = {CanvasAgent: Enabling Complex Image Creation and Editing via Visual Tool Orchestration}, author = {CanvasAgent Team}, year = {2026}, note = {Dataset: CanvasCraftSFT} }





