# Nest this run.

> The Renest panel is a ComfyUI sidebar tab that packs the workflow on your canvas into a nest on this machine's disk. It previews what will go in, then packs and checks every file. It talks only to a local renest serve process on 127.0.0.1:7799, using a token kept in a 0600 file on the same machine, and it uploads nothing.

Canonical page: https://renest.ai/docs/plugin-nest-this-run

<h2 id="what">The panel is a thin front end; the renest engine does the packing</h2>

<p>The panel adds a <strong>Renest</strong> tab to the ComfyUI sidebar. It has two halves:
a small piece of Python that runs inside ComfyUI, and browser code that draws the tab. Neither
half packs anything itself. Packing is done by the <code>renest</code> command-line tool,
running as a local service (<code>renest serve</code>) on the same machine. The panel reaches
it over plain HTTP on the loopback address, and that HTTP interface is the only connection
between the two.</p>

<p>The panel follows ComfyUI's licence (GPL-3.0-or-later). The engine is a separate program
that is source-available, not open source. The process boundary between them is also the
licence boundary.</p>

<h2 id="install">You install two things: the panel inside ComfyUI, and the engine once per machine</h2>

<p><strong>The panel.</strong> In ComfyUI-Manager, search for "Renest", install it,
restart ComfyUI, then refresh the browser tab so the Renest tab shows up. Or clone it by
hand:</p>

<pre>$ cd ComfyUI/custom_nodes
$ git clone https://github.com/renest-ai/comfyui-renest</pre>

<p>It needs a ComfyUI frontend that has the sidebar extension API. It adds no nodes to the
node list, and it has no Python dependencies of its own.</p>

<p><strong>The engine.</strong> In any terminal on the same machine:</p>

<pre>$ uv tool install --upgrade renest
$ export PATH="$HOME/.local/bin:$PATH"
$ renest serve</pre>

<p>Install it with <code>uv</code> rather than <code>pip</code> inside ComfyUI's own
environment: <code>pip install renest</code> would add packages to the very environment you
are about to capture. The engine needs Python 3.11 or newer, but that Python does not have to
be the one running ComfyUI. On the Windows portable build, use a normal Python install, not
the embedded one. The install command needs <code>uv</code>. No <code>uv</code> yet?
<code>curl -LsSf https://astral.sh/uv/install.sh | sh</code> puts one there first.</p>

<p><code>renest serve</code> listens on <code>127.0.0.1:7799</code> by default.
<code>--port</code> (or <code>RENEST_SERVE_PORT</code>) changes the port, but the panel always
connects to 7799, so leave it at the default when you use the panel.</p>

<p>If the engine is not running, the tab says so and shows these two commands with a
<em>Copy</em> button and a <em>Check again</em> button. Nothing else needs configuring.</p>

<h2 id="remote">On a rented machine, open ComfyUI through an SSH tunnel so the panel can reach the engine</h2>

<p>The panel's browser code connects to <code>http://127.0.0.1:7799</code>. That address
is resolved <em>by your browser</em>, which means it points at the computer the browser runs
on, not at the pod. The engine also accepts browser requests only from loopback pages
(<code>127.0.0.1</code> or <code>localhost</code>). So if you open ComfyUI through a provider's
web address, the tab can't reach the engine and says it isn't running, even when it is.</p>

<p>Forward both ports over SSH, then open ComfyUI locally. Start from the SSH command your
provider shows for the machine and add the two <code>-L</code> options:</p>

<pre>$ ssh -N -L 8188:127.0.0.1:8188 -L 7799:127.0.0.1:7799 &lt;user&gt;@&lt;machine-address&gt; -p &lt;ssh-port&gt;
# then browse to http://127.0.0.1:8188/</pre>

<p>If you can't tunnel, pack from the pod's terminal instead. <code>renest pack</code> does
the same capture without the panel (see the <a href="/docs/guide-runpod">RunPod</a> and
<a href="/docs/guide-vast">vast.ai</a> guides).</p>

<h2 id="button">The button previews first, then packs, then checks every file</h2>

<p>When a run finishes successfully, the panel shows a notice telling you to nest it from the
Renest tab. Pressing <strong>Nest this run</strong> works through these steps:</p>

<ol>
  <li><strong>Reads the canvas.</strong> The panel turns the workflow currently on the canvas
  into ComfyUI's API format. An empty canvas stops here, with a note saying there is nothing
  to nest yet.</li>
  <li><strong>Asks for a preview.</strong> It sends that workflow to the engine together with
  three facts only code inside ComfyUI can know: the data folder, the folder ComfyUI's own
  program lives in, and the Python interpreter running it. The engine does a dry run and
  writes nothing.</li>
  <li><strong>Shows "What goes in the nest".</strong> This lists counts and sizes for
  <em>Models</em>, <em>ComfyUI itself</em>, <em>Custom nodes</em> and <em>Dependency
  locks</em>, followed by an <em>Estimated size</em> and <em>Saved on this machine to</em>
  with the exact folder. Anything the engine could not capture appears under <em>Worth
  reading before you save</em>. One example is a custom node dropped in as a plain unzip, with
  no origin to record. Read that box: a list that looks complete but isn't is the one that
  costs you later.</li>
  <li><strong>Packs when you confirm.</strong> Give it a name (the default is the folder name
  and today's date) and press <strong>Confirm &amp; nest</strong>. The engine queues a job.
  The panel checks on it once a second and shows the stage, a progress bar and plain-language
  log lines. <em>Cancel</em> stops the job.</li>
  <li><strong>Finishes on "Nested &amp; verified".</strong> That line appears only after the
  engine has written the nest and checked every file against its recorded checksum. The folder
  path is shown under it. If packing fails, the panel shows <em>Packing failed</em> and the
  engine's own explanation.</li>
</ol>

<p>Packing from the panel always records a direct download address for packages that are
pinned to a vendor-only build (such as a CUDA-specific <code>torch</code>). A machine that just
ran a workflow has network access, and a nest sealed from the panel should never be one that
can't be put back elsewhere.</p>

<h2 id="record">The panel keeps a small run record so packing can use facts from the live run</h2>

<p>Some facts about a run exist only while ComfyUI is running. So the panel's Python half
watches the status messages ComfyUI already sends to the browser. It changes nothing about
them. Whenever a prompt ends (finished, failed or interrupted), it writes one file beside
ComfyUI's program folder:</p>

<pre>&lt;ComfyUI program folder&gt;/.renest/native-libs.json</pre>

<p>It records:</p>

<ul>
  <li><strong>Which node pack each loaded node type came from</strong>, as ComfyUI itself
  reports it. Without this, packing would have to search custom node folders for class names
  as text, which misses packs that build node names at start-up.</li>
  <li><strong>The most video memory the run was seen using</strong>, sampled at most every
  couple of seconds while a prompt runs, along with the sampling interval. This is kept
  <em>only when the run finished successfully</em>. A run that stopped on its first node would
  otherwise leave a figure far below what the workflow really needs.</li>
  <li>When the record was written, and which Python wrote it.</li>
</ul>

<p>The engine reads this file when it packs, both for the preview and for the real pack. The
node owners decide which custom nodes go in. The video memory figure goes into the nest, where
the pre-flight check on another machine can compare it against that machine's card. A nest
with no figure says nobody measured, and the check reports exactly that instead of passing.</p>

<p>The operating-system libraries a run loaded are read by the engine from the running ComfyUI
process, not from this file. If ComfyUI is already closed when you pack, the engine can only
use what the installed packages declare. Packing tells you so, and the fix is to start
ComfyUI and pack again.</p>

<h2 id="where">The nest is written beside your ComfyUI folder, in renest-nests</h2>

<pre>&lt;the folder holding your ComfyUI&gt;/renest-nests/
├─ nests/&lt;nest-id&gt;/manifest.json
└─ blobs/sha256/…</pre>

<p>That folder sits next to your ComfyUI install, so it is on whichever disk you already chose
for it and your models. On a rented machine, check which of its disks keep their contents when
you stop it before you rely on the nest staying there. Two cases land elsewhere, in your
per-user data folder (on Linux, normally <code>~/.local/share/renest</code>):</p>

<ul>
  <li><strong>ComfyUI sits at the root of the filesystem</strong> (such as
  <code>/ComfyUI</code>): the nest goes to <code>renest-nests</code> inside that data folder,
  <code>~/.local/share/renest/renest-nests</code> on Linux.</li>
  <li><strong>The chosen folder isn't writable:</strong> the nest goes to <code>nests</code>
  inside that data folder, <code>~/.local/share/renest/nests</code> on Linux.</li>
</ul>

<p>The preview shows the real path either way.</p>

<p>The panel never uploads. To put the nest back, on this machine or on another one you
bring the whole folder to, run <code>renest restore --manifest
&lt;folder&gt;/nests/&lt;nest-id&gt;/manifest.json --dir ./run</code>. Restore reads the files
from the <code>blobs/sha256</code> folder beside <code>nests</code>, so keep the two
together. To keep a copy on your Renest drive, pack from the terminal with <code>--dest
hosted</code> (see the platform guides).</p>

<h2 id="token">A local token, stored in a 0600 file, is the only secret between the panel and the engine</h2>

<p>Every engine endpoint except its health check needs a token. This is how that token moves:</p>

<ol>
  <li><strong>The engine creates it.</strong> The first time <code>renest serve</code> starts,
  it generates a random token and writes it with owner-only permissions (0600):
  <ul>
    <li>Linux: <code>~/.config/renest/serve.token</code></li>
    <li>macOS: <code>~/Library/Application Support/renest/serve.token</code></li>
    <li>Windows: <code>AppData\Local\renest\renest\serve.token</code> under your home folder</li>
  </ul>
  If you choose another location with <code>--token-file</code> or
  <code>RENEST_TOKEN_FILE</code>, the engine also writes that location into a file named
  <code>token-path</code> (0600), next to where the default token file would be. The panel
  looks for <code>token-path</code> only in <code>~/.config/renest/</code>, so for now a custom
  location is found automatically on Linux only. On macOS and Windows, keep the token in its default place.</li>
  <li><strong>The panel's Python half reads the file</strong> each time the browser asks for
  the token, and returns it from ComfyUI's own server at <code>/renest/token</code>.</li>
  <li><strong>The browser code keeps it in a variable.</strong> It is never written to
  localStorage, sessionStorage or a cookie. It is sent only as an
  <code>Authorization</code> header to <code>127.0.0.1:7799</code>, and it is gone when the
  page reloads.</li>
  <li><strong>The engine re-reads the file on every request.</strong> To replace the token,
  delete the file, restart <code>renest serve</code>, and reload the ComfyUI page.</li>
</ol>

<p>Know the limits of this token. Anyone who can open your ComfyUI page can ask for it,
because it is served there. It is only useful from the machine itself: the engine listens on
<code>127.0.0.1</code> and refuses to start on any other address. It lets the holder start
pack and restore jobs on this machine. It is not your Renest account key, and it can't read
your drive.</p>

<h2 id="never">No cloud credentials and no uploads pass through the panel</h2>

<ul>
  <li><strong>No bucket keys or account tokens.</strong> If you configure the engine to upload,
  the credentials stay the engine's business, read from its own config or environment. The
  panel never sees, stores or forwards them. Those credentials have their own home, a 0600
  config file for the command-line tool, which the platform guides cover.</li>
  <li><strong>No uploads.</strong> A nest from the panel is written to your own disk and
  nowhere else.</li>
  <li><strong>No imports of engine code.</strong> The panel talks to the engine over HTTP
  only.</li>
</ul>
