inference-and-export
Run zi2zi checkpoint inference, style interpolation, transition GIF planning, and generator-only export from legacy TensorFlow 1.x checkpoints.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference-and-export
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Run zi2zi checkpoint inference, style interpolation, transition GIF planning, and generator-only export from legacy TensorFlow 1.x checkpoints.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/checkpoints-and-outputs.md2.0 KB
- 参考文档references/inference-workflow.md2.5 KB
- 参考文档references/troubleshooting.md2.0 KB
- 脚本scripts/plan_zi2zi_inference.py5.5 KB
03 SKILL.md 正文
zi2zi inference and export
Use this sub-skill when a task is about generating glyphs from a trained zi2zi checkpoint, interpolating between style labels, creating frame sequences or a GIF, or exporting generator-only variables for later reuse. It does not launch long inference jobs automatically; it explains the checkpoint contract and prints safe command templates.
Use this sub-skill when
- The user has a checkpoint directory and wants generated glyphs.
- The task mentions
infer.py,export.py,model_dir,source_obj,embedding_ids,interpolate,steps,output_gif,uroboros, or exported generator weights. - The user wants to know how inference chooses between single-style generation and random style selection.
- The user needs to diagnose checkpoint restore failures, output-image naming, or interpolation problems.
Route elsewhere
- Data rendering and
.objpackaging go to data-preparation. - Training, fine-tuning, or label shuffling go to training-and-model.
- Compatibility questions go to the root compatibility reference.
Core inference facts
infer.pyrestores generator variables from a checkpoint and uses a source object file to provide images.- If
embedding_idscontains one integer, the model uses that style for every source image. If it contains multiple IDs, the script picks randomly from the list for each batch. interpolate=1asks the model to linearly interpolate between style vectors. Withuroboros=1, the interpolation path closes the loop by appending the first ID to the end of the chain.output_giftriggers GIF compilation from the rendered interpolation frames.export.pysaves generator-only variables, which include the embedding table and generator weights.
Output conventions
- Normal inference writes files named
inferred_%04d.pngin the save directory. - Interpolation writes
frame_<src>_<dst>_step_<idx>.pngfiles. - GIF compilation expects those frame PNGs in the save directory and writes the named GIF beside them.
- Export uses TensorFlow checkpoint naming with a generator model prefix.
Recommended workflow
- Verify the checkpoint directory contains a TensorFlow checkpoint state.
- Decide whether you want one style ID, a random mix, or interpolation between two or more style IDs.
- Confirm the source object file contains paired glyph records and that its batch size is compatible with the inference command.
- Use the command planner to validate flags and paths before launching any long job.
- Inspect outputs after the first few batches, especially if the chosen style labels or batch size do not match the training run.
Read inference-workflow.md for command shapes and evaluation steps. Read checkpoints-and-outputs.md for restore/export expectations and filename conventions. Read troubleshooting.md for checkpoint, batch-size, GIF, and source-object failures.
Bundled helper
- scripts/plan_zi2zi_inference.py validates inference, interpolation, and export arguments and prints the command that a future agent should run in a legacy zi2zi environment.
What not to promise automatically
- Do not promise restoration of a checkpoint without checking that the concrete checkpoint files exist and match the chosen hyperparameters.
- Do not promise a successful interpolation run unless
embedding_idscontains at least two integers. - Do not promise export success if the model directory contains only partial or mismatched checkpoint shards.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).