← Back to skills
extension
Category: Content & MediaAPI key requirement unconfirmed

editing-model-dataset-tagger

Generate detailed START-to-END training labels for image editing datasets. Use when the user wants to pair *_start/*_end images, analyze visual edit differences, produce English edit-instruction labels with Chinese review text, run smart/professional-role/theme-focus tagging, resume interrupted batches, perform QC, or package a dataset for image-editing model or LoRA training.

personAuthor: atent2Lhubgithub

Editing Model Dataset Tagger

Use this skill to turn paired image-editing examples into detailed, executable START -> END training instructions.

Default workflow

  1. Confirm the input is a folder or ZIP containing paired images named *_start.<ext> and *_end.<ext>.
  2. Choose a tagging mode:
    • smart: default when the user wants the model to discover all real edit changes by itself.
    • role: use when the user supplies a professional perspective/persona, such as anime annotation, portrait retouching, photography, clothing design, etc.
    • focus: use when the user wants labels restricted to a specific theme or learning target.
  3. Keep the validated production defaults unless the user explicitly asks to experiment:
    • 8 pairs per API request.
    • Up to 4 pairs per contact sheet.
    • Programmatic label composition from all valid dimension scans; do not ask the model to summarize the final label again.
  4. Run the main script. Re-running the same command with the same output directory resumes from the checkpoint automatically.
  5. Validate the outputs and report any items marked needs_review.

Before running

Check that Python dependencies are installed:

python -m pip install -r requirements.txt

Check that a ModelScope API token is available without printing the secret:

python -c "import os; print('OK' if os.getenv('MODELSCOPE_API_TOKEN') else 'MISSING')"

If the token is missing, ask the user to set MODELSCOPE_API_TOKEN. Never write the token into source files, logs, prompts, README files, or command history examples.

Run commands

Smart analysis — default

python scripts/tag_dataset.py /path/to/dataset.zip --output output --mode smart

Use this when the user says things like “AI 自己分析”, “尽可能详细”, “不要漏变化”, or does not provide a narrower theme.

Professional role

python scripts/tag_dataset.py /path/to/dataset.zip \
  --output output \
  --mode role \
  --role "专业二次元图像编辑数据标注师"

The role changes observation sensitivity and terminology only. It is never visual evidence.

Theme focus

python scripts/tag_dataset.py /path/to/dataset.zip \
  --output output \
  --mode focus \
  --theme "夏日碎光" \
  --focus "曝光、局部受光、色温、阴影、通透感、光斑" \
  --extra "保持人物身份和构图不变" \
  --strict-theme

Use strict theme mode when unrelated changes must stay out of the formal training label.

Resume behavior

Do not delete the output directory after an interruption.

Re-run the same command. The script will:

  1. Read output/checkpoint.json.
  2. Verify the dataset fingerprint and tagging configuration.
  3. Preserve already completed pair results.
  4. Continue only the remaining pairs.
  5. Print progress against the full dataset, not against the restarted remainder.

If the user intentionally changed the mode, model, role, theme, focus, or other tagging configuration, use a new output directory or --force-restart.

Output contract

A successful run creates:

output/
├── results.json
├── run_summary.json
├── checkpoint.json
├── 编辑模型训练包.zip
└── 编辑模型检查包.zip

Training package:

0001_start.png
0001_end.png
0001.txt
...

Inspection package:

中文对照/
  0001.txt
  ...
标签检查报告.csv
处理说明.txt

If a run stops after partial completion, partial training/check packages are still generated and the checkpoint is kept.

Validation rules

After the run:

  1. Read run_summary.json.
  2. Confirm completed_pairs == total_pairs for a complete job.
  3. Inspect needs_review_count.
  4. If review items exist, open 标签检查报告.csv from the inspection ZIP or inspect results.json.
  5. Do not silently repair uncertain visual claims. If a pair is ambiguous, surface it for manual review.

Important tagging rules

  • Labels describe editing actions from START to END, not static captions of END.
  • Every formal change must be supported by visible START/END evidence.
  • Detailed information is preferred over short summaries in smart mode.
  • Do not invent numeric exposure values, focal lengths, color temperatures, or other exact parameters that are not visually recoverable.
  • Do not infer changes merely from a theme name or professional role.
  • Empty dimensions stay empty.
  • The program composes final labels from all complete non-empty dimension entries so model-side summarization cannot drop already-detected changes.

Data handling

The local dataset is scanned and paired locally. Contact sheets derived from START/END images are sent to the configured ModelScope API-Inference endpoint for visual analysis. Do not claim that the images remain fully local during inference.

References

Read only what is needed for the task:

Gotchas

  • Do not change the default 8 pairs/request merely because labels are long. The current smart prompt was specifically strengthened to preserve detail before reducing batch size.
  • Do not let a role or theme become a source of facts. They only control what to inspect or prioritize.
  • Do not ask the model to create a second summary after dimension scanning; that previously caused information loss.
  • Do not restart from pair 1 after a recoverable failure. Preserve the checkpoint and continue.
  • jfif, jpg, jpeg, png, webp, bmp, and gif are recognized. Unsupported images should be surfaced rather than silently skipped when they are expected pairs.