# Capture a run.

> renest pack captures a run that already worked: the model weights and adapters it used, each custom node's source pinned to its commit, the dependency lock, and the workflow or training config that produced the result, written as a nest to your disk and, if you ask, to your drive.

Canonical page: https://renest.ai/docs-capture.html

<h2 id="when">Pack after it works, not before</h2>

<p>Renest captures a result you already have. Get the workflow rendering or the training
run finishing first; then pack it. There is no mode where Renest helps you get an
unfamiliar setup running — that's a different product. What Renest keeps is the files and
dependencies of a run that worked, checked; it can't do that for a run that never
worked.</p>

<p>Before packing anything, look at the plan:</p>

<pre>$ renest pack --dir ./run --workflow workflow-api.json --dry-run</pre>

<p>That prints what would be captured and writes nothing.</p>

<h2 id="image">Image workflows (ComfyUI)</h2>

<pre>$ renest pack --dir ./run --workflow workflow-api.json --out ./nests</pre>

<p><code>--dir</code> is the environment root — the folder that holds <code>ComfyUI/</code>
— and <code>--out</code> is where the nest is written; a real pack needs both.
<code>--workflow</code> is the workflow exported in <strong>API format</strong> — in ComfyUI,
<em>Export (API)</em>; the ordinary saved workflow is refused with a note saying so. Renest reads it to work out which models
and nodes the run actually touched, instead of hoovering up the whole disk.</p>

<p>If ComfyUI lives somewhere unusual, point at it with <code>--comfyui-dir</code>. The
ComfyUI desktop app keeps its own program files apart from your nodes and models; point
<code>--program-dir</code> at the program folder and <code>--dir</code> at the one with your
nodes and models. The nest that comes out is an ordinary ComfyUI install either way.</p>

<p>No workflow to name? <code>--auto</code> packs the folder as it stands. It looks for a
picture ComfyUI already produced in its output folder (the recipe travels inside the
picture) and uses it to check the file list. If it finds none, it still packs, and the
nest records that nobody saw this environment produce anything — a restore of it has no
finished run to repeat.</p>

<p>The <a href="docs-plugin-nest-this-run.html">ComfyUI panel</a> does the same packing
from a button in ComfyUI's sidebar.</p>

<h2 id="training">Fine-tuning runs (kohya_ss and LLaMA-Factory)</h2>

<pre>$ renest pack --dir ./run --framework kohya --run-record run.json --out ./nests
$ renest pack --dir ./run --framework llamafactory --run-record run.json --out ./nests</pre>

<p><code>--run-record</code> is a small JSON file describing the training run that worked —
<code>&#123;"cwd": …, "argv": [...], "env": &#123;…&#125;&#125;</code>: the working directory, the
command line, the environment. Renest reads the recipe out of it: for kohya_ss that is the
command line itself, for LLaMA-Factory the config file the command names. Without it,
<code>--framework</code> stops and says so.</p>

<p>Run the training command through <code>renest watch</code> while it trains, and the
nest also records which machine libraries the run really loaded. A trainer exits when it is
done, so by packing time there is nothing left to ask; <code>watch</code> records it while
the run is happening, inside the folder you will pack (<code>--env-root</code>, default the
current one). It changes nothing about the run — same arguments, same output, same exit
code:</p>

<pre>$ renest watch -- accelerate launch train_network.py --config config.toml</pre>

<p>Two named frameworks, on purpose: <strong>kohya_ss</strong> and
<strong>LLaMA-Factory</strong>. Both state their settings somewhere Renest can read them
back, which is what makes a capture a recipe rather than a backup. An arbitrary training
script states them nowhere — there'd be nothing to capture except "copy these bytes", so it
isn't offered.</p>

<p>The output of a fine-tuning run is the input to an image workflow: the adapter kohya
trains is the one ComfyUI loads. They're two ends of one chain, not two products.</p>

<h2 id="inside">What ends up inside</h2>

<ul>
  <li><strong>Weights and adapters</strong> the run referenced, each stored under the
  checksum of its bytes, so the same file is kept once.</li>
  <li><strong>Custom nodes, archived in full</strong> and pinned to the commit that was
  there — not "latest", which is what quietly breaks a restore two weeks later. The source
  travels with the nest, so a restore doesn't depend on that repository still existing.</li>
  <li><strong>The Python dependency lock</strong>, so packages are reinstalled at the
  versions that worked. Packages pinned to a vendor-only version (like
  <code>torch==…+cu124</code>) also get their direct wheel links recorded, by default —
  unless you pack with <code>--offline</code>, which needs no network but leaves the nest
  marked as not restorable on another machine.</li>
  <li><strong>The workflow or training config</strong> that produced the result.</li>
  <li><strong>A fingerprint of the machine</strong> — GPU model, architecture, driver — so a
  later restore can warn you when the target hardware can't run what was compiled here.</li>
</ul>

<p>When the dependency list can't be installed on another machine as recorded — packages
that belong to conda or the operating system rather than a package index, or ones installed
from a folder with <code>pip install -e .</code> — the pack still finishes, because the
files are still a faithful record of this machine, but it says so, names the packages and
the fix, and marks the nest as not restorable elsewhere. Handing such a nest off to
someone else can be refused for the same reason. Restoring it yourself is not refused up
front: the restore's own check, before any model files move, finds out whether the list
installs on that machine.</p>

<p>If something in your code folder looks like a credential, the pack stops: a nest carries
your code folder as it is, to anyone you hand it to. Remove it, or pack with
<code>--i-know</code> if you are sure it is not a real one.</p>

<h2 id="mine">Say which files are your own with --mine</h2>

<p>Files you did not make are treated as restricted by default, and restricted files never
travel to someone you <a href="docs-handoff.html">hand the nest off</a> to — they fetch those
themselves, under their own terms. That is right for downloaded models and wrong for your
own work. Declare a LoRA you trained, or your own images, by its path inside the
environment; repeat the flag for more:</p>

<pre>$ renest pack --dir ./run --workflow workflow-api.json --out ./nests &#92;
    --mine ComfyUI/models/loras/my-style.safetensors</pre>

<p>A licence lookup that recognises the file still wins, so <code>--mine</code> can't loosen
a real restricted model. It only matters for hand-offs; restoring your own nest from your
drive is not affected.</p>

<h2 id="where">Where it goes: your disk, and your drive if you ask</h2>

<p><code>--out</code> says where the nest is written on this machine.
<code>--dest hosted</code> also uploads it to your Renest drive as it packs, so it isn't left
only on the machine you're about to destroy. That needs an access key (see
<a href="docs-cli.html#auth">Signing in to your drive</a>), and the key is checked before
packing starts.</p>

<p>Pack the same folder again and the new pack becomes a new version of the same nest.
<code>--new-nest</code> starts a separate nest instead, and <code>--nest-id</code> adds the
new version to a nest you name. <code>--nest-name</code> gives a new nest a name.</p>

<p>If you keep nests in a bucket of your own rather than on the drive,
<code>--dest s3</code> uploads there instead; <code>renest doctor --storage</code> shows how
to set the bucket up.</p>

<h2 id="not">What it won't do</h2>

<ul>
  <li><strong>It won't judge compatibility between nodes.</strong> If two nodes fought on
  your machine, they'll fight on the restored one — faithfully.</li>
  <li><strong>It won't recommend or curate models.</strong> It captures what you used.</li>
  <li><strong>It won't claim a run it never saw.</strong> A nest packed without any record of
  a finished run says so in its manifest, instead of looking like one that was.</li>
  <li><strong>It won't take your storage key to a rented machine.</strong> The machine you
  restore on gets a <a href="docs-restore.html#codes">restore code</a> instead.</li>
</ul>
