Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ComfyUI → Obsidian Prompt Note
Кастомная нода для ComfyUI, которая после генерации автоматически сохраняет готовое изображение и позитивный промт в отдельную заметку Obsidian.
A ComfyUI custom node that, after each generation, automatically saves the finished image and the positive prompt into a dedicated Obsidian note.
🇷🇺 Русский
Что делает нода
Нода Save Image + Obsidian Note (категория Obsidian) для каждого
изображения:
- Сохраняет PNG в стандартную папку
outputComfyUI (с обычной нумерацией и вшитыми метаданными workflow — как штатная нодаSave Image). - Копирует этот PNG в папку для заметок (по умолчанию
Comfy-Promtвнутри вашего хранилища Obsidian). - Создаёт рядом заметку
.mdс тем же именем, что у изображения, но без расширения (например,ComfyUI_00042_.md). Внутри:- встроенное изображение
![[ComfyUI_00042_.png]]; - позитивный промт в блоке кода — чтобы его можно было скопировать одним кликом.
- встроенное изображение
Пример содержимого заметки:
![[ComfyUI_00042_.png]]
```
a cinematic portrait of a fox, golden hour, 85mm, highly detailed
```
Установка
-
Скопируйте папку
comfyui-obsidian-promtв каталогcustom_nodesвашего ComfyUI.- ComfyUI Desktop / portable:
...\ComfyUI\custom_nodes\ - В этой системе:
C:\Users\dimir\Documents\ComfyUI\custom_nodes\
Либо клонируйте репозиторий прямо туда:
cd C:\Users\dimir\Documents\ComfyUI\custom_nodes git clone http://192.168.1.171:3000/dimon/comfyui-obsidian-promt.git - ComfyUI Desktop / portable:
-
Настройте путь сохранения (см. раздел ниже) — иначе заметки будут падать в чужую папку.
-
Полностью перезапустите ComfyUI. Нода появится в меню добавления нод в категории Obsidian под именем Save Image + Obsidian Note.
Дополнительные зависимости не нужны: numpy, Pillow и folder_paths уже
входят в любую сборку ComfyUI.
Как использовать
Добавьте ноду Save Image + Obsidian Note в конец workflow (вместо или рядом
со штатной Save Image) и подключите images к выходу VAE Decode.
Текст промта нода может получать двумя способами — выбирается переключателем
prompt_source:
| Режим | Что подключать | Откуда берётся текст |
|---|---|---|
string (по умолчанию) |
вход positive_prompt (тип STRING) |
строка ровно как вы её ввели |
conditioning |
вход positive_conditioning (тип CONDITIONING) |
текст прослеживается по графу workflow до ноды CLIP Text Encode и читается её поле text |
Режим string — подключите строковую ноду с текстом (например String/Text
из comfyui-custom-scripts или KJNodes). Удобно, если промт формируется
динамически (wildcards / dynamic prompts): берите строку уже после раскрытия,
тогда в заметку попадёт финальный текст.
Режим conditioning — подключите тот же выход CLIP Text Encode, что идёт в
KSampler. Отдельная строковая нода не нужна.
⚠️ Важно про режим
conditioning. Из CONDITIONING (это числовые эмбеддинги) исходный текст восстановить невозможно — кодирование одностороннее. Поэтому нода идёт по графу workflow назад от подключённого входа до нодыCLIP Text Encodeи читает её текстовое поле. Для обычных статических промтов это точно. Промежуточные ноды (Conditioning Combine/Concatи т. п.) проходятся насквозь, тексты склеиваются. Если же текст подставляется вCLIP Text Encodeнестандартным способом (некоторые wildcard-/BNK-ноды), из графа может прочитаться шаблон или ничего — тогда в заметку попадёт пометка[промт не найден: ...]. В таких случаях используйте режимstring.
Опциональный вход filename_prefix (по умолчанию ComfyUI) задаёт префикс имени
файла — как у штатной Save Image.
Как изменить папку для сохранения
Откройте файл __init__.py и найдите вверху блок
НАСТРОЙКА ПУТЕЙ / PATH CONFIGURATION. Там две строки:
VAULT_DIR = r"C:\Users\dimir\Documents\ObsidianTask"
OBSIDIAN_SUBFOLDER = "Comfy-Promt"
VAULT_DIR— полный путь к хранилищу Obsidian (или к любой другой папке). На Windows используйте префиксr"..."и обратные слэши.OBSIDIAN_SUBFOLDER— имя подпапки внутриVAULT_DIR, куда складываются.mdи копии.png. Папка создаётся автоматически. Чтобы писать прямо вVAULT_DIR, поставьте пустую строку"".
Примеры:
VAULT_DIR = r"D:\MyVault" # другой диск
VAULT_DIR = r"\\NAS\share\Obsidian" # сетевая папка
VAULT_DIR = "/home/user/Obsidian" # Linux / macOS
OBSIDIAN_SUBFOLDER = "" # писать прямо в корень vault
После изменения сохраните файл и перезапустите ComfyUI.
🇬🇧 English
What the node does
The Save Image + Obsidian Note node (category Obsidian) does the
following for every image:
- Saves the PNG to ComfyUI's standard
outputfolder (normal numbering, with the workflow metadata embedded — just like the built-inSave Imagenode). - Copies that PNG into the notes folder (by default
Comfy-Promtinside your Obsidian vault). - Creates a
.mdnote next to it with the same name as the image but without the extension (e.g.ComfyUI_00042_.md). Inside:- the embedded image
![[ComfyUI_00042_.png]]; - the positive prompt inside a code block, so you can copy it in one click.
- the embedded image
Example note content:
![[ComfyUI_00042_.png]]
```
a cinematic portrait of a fox, golden hour, 85mm, highly detailed
```
Installation
-
Copy the
comfyui-obsidian-promtfolder into your ComfyUIcustom_nodesdirectory.- ComfyUI Desktop / portable:
...\ComfyUI\custom_nodes\
Or clone the repository directly there:
cd /path/to/ComfyUI/custom_nodes git clone http://192.168.1.171:3000/dimon/comfyui-obsidian-promt.git - ComfyUI Desktop / portable:
-
Configure the save path (see the section below) — otherwise notes will end up in the wrong folder.
-
Fully restart ComfyUI. The node appears in the add-node menu under the Obsidian category as Save Image + Obsidian Note.
No extra dependencies are required: numpy, Pillow and folder_paths already
ship with every ComfyUI build.
How to use
Add the Save Image + Obsidian Note node at the end of your workflow (instead
of or alongside the built-in Save Image) and connect images to the
VAE Decode output.
The node can obtain the prompt text in two ways, selected with the
prompt_source switch:
| Mode | What to connect | Where the text comes from |
|---|---|---|
string (default) |
the positive_prompt input (STRING) |
the string exactly as you typed it |
conditioning |
the positive_conditioning input (CONDITIONING) |
the text is traced through the workflow graph back to the CLIP Text Encode node and read from its text field |
string mode — connect a string/text node (e.g. String/Text from
comfyui-custom-scripts or KJNodes). Best when the prompt is built dynamically
(wildcards / dynamic prompts): tap the string after it has been expanded so the
final text lands in the note.
conditioning mode — connect the same CLIP Text Encode output that feeds
your KSampler. No separate string node needed.
⚠️ Important about
conditioningmode. The original text cannot be recovered from a CONDITIONING tensor (encoding is one-way). Instead the node walks the workflow graph backwards from the connected input to theCLIP Text Encodenode and reads its text field. This is exact for ordinary static prompts. Intermediate nodes (Conditioning Combine/Concat, etc.) are traversed and their texts are concatenated. If the text is fed intoCLIP Text Encodein a non-standard way (some wildcard/BNK nodes), the graph may only contain a template or nothing — the note will then contain a[prompt not found: ...]marker. Usestringmode in those cases.
The optional filename_prefix input (default ComfyUI) sets the filename prefix,
just like the built-in Save Image.
How to change the save folder
Open __init__.py and find the НАСТРОЙКА ПУТЕЙ / PATH CONFIGURATION block
near the top. It contains two lines:
VAULT_DIR = r"C:\Users\dimir\Documents\ObsidianTask"
OBSIDIAN_SUBFOLDER = "Comfy-Promt"
VAULT_DIR— full path to the Obsidian vault (or any other folder). On Windows use anr"..."prefix and backslashes.OBSIDIAN_SUBFOLDER— subfolder name insideVAULT_DIRwhere the.mdnotes and.pngcopies go. It is created automatically. Set it to an empty string""to write directly intoVAULT_DIR.
Examples:
VAULT_DIR = r"D:\MyVault" # different drive
VAULT_DIR = r"\\NAS\share\Obsidian" # network share
VAULT_DIR = "/home/user/Obsidian" # Linux / macOS
OBSIDIAN_SUBFOLDER = "" # write into the vault root
After editing, save the file and restart ComfyUI.
License
MIT