A terminal-based companion program for ComfyUI.

Related tags

Command-line yara
Overview

Yara

Yara is a companion tool for ComfyUI, based in the terminal. It can:

  • Pause queue generations by saving/loading them to files
  • Cancel queued generations by their number/ID
  • Toggle sleep mode, to prevent your computer from going to sleep and halting ComfyUI
  • Examine the prompts and models in the running/pending queue
  • Wait until all jobs/prompts are finished, estimating the remaining time
  • Create an always-on-top window to display the latest generated image
  • Display an image's embedded generation data
  • Help download from CivitAI

Installation

Usage


Installing

Direct link to download

Download "yara.exe". Open a terminal in the same directory/folder as "yara.exe", and run the program through the terminal by simply typing "yara".

The first time you run, you must select your ComfyUI output folder, and then a config file will automatically be created. You can open the folder containing the config file with the argument "yara config", to edit it manually (most of the options are just for configuring "yara preview").



Usage

  1. Saving, Loading, Deleting, and Listing Queues
  2. Examining the Running Queue
  3. Deleting Generations by Number
  4. Toggle Sleep Mode
  5. Check an Image's Embedded Generation Info
  6. Create a Window Displaying the Most Recently Generated Image
  7. Open the Folder Containing the Config File
  8. Download From CivitAI
  9. Print Help
  10. Aliases

Saving, Loading, Deleting, and Listing Queues

To save pending generations to a file, run

yara save [name]

You can alternatively use "yara save -wr [name]" instead, if you wish to additionally save the currently active/in-progress generation. Note that Yara cannot save a partial generation; saving and loading an in-progress job will restart the generation from the beginning.

Now, you may clear out the queue or close ComfyUI. When you later want to resume generation, queue them up again by running

yara load [name]

You can print out a list of all saved queues by typing

yara list

and you can delete a saved queue with

yara delete [name]

Warning: After saving/loading generations, resulting images will not have the workflow embedded in them; i.e. you can no longer drag/drop them into ComfyUI to recreate the workflow. The generation details (prompt, model, loras, seed, etc) are still embedded within the image, though, and you can view that by either reading the image file as a text file, or using Yara's image-generation-info function ('yara image').

From ComfyUI Github Issue #69, importing workflows from the api prompt format is planned, so this will hopefully be fixed later.

Examining the Running Queue

To print out the IDs of all queued prompts, as well as their model(s), lora(s), and positive prompt text, run

yara examine

This can be useful if you load up a long queue, but forget the details of them. Or, if you messed up some of the prompts (.e.g forgot to remove a lora) and want to know which prompt ID's to delete, this can help.

Deleting Generations by Number

To cancel queued generations, run

yara cancel [prompt IDs]

where [prompt IDs] is a space-separated list of prompt IDs (the incrementing numbers labeling queues when you use "See Queues" in ComfyUI).

You can also append "+" to a prompt ID to cancel that prompt as well as the next 100 prompts up, or specify an inclusive range of prompts using "-" as a separator.

yara cancel 60+       // Cancel generations 60, 61, 62, ..., 157, 158, 159

yara cancel 25-30     // Cancel generations 25, 26, 27, 28, 29, 30

Deleting many prompts in ComfyUI is cumbersome. When you accidentally queue prompts with incorrect parameters or no longer care about a portion of the queue, this will make partial cancellation much faster and easier.

Toggle Sleep Mode

ComfyUI doesn't prevent Windows from sleeping, but sleep mode halts ComfyUI generations. You can use yara to conveniently toggle sleep mode with

yara caffeine   // disable sleep mode
yara melatonin  // enable sleep mode

By default, 'melatonin' will have Windows sleep after 30 minutes of inactivity. You can customize this length in the config file.

Halt Terminal Until Queue Is Empty

To hold the terminal until the ComfyUI queue is empty, run

yara wait

While waiting, it will print the number of remaining generations every five minutes. It also will estimate (incredibly roughly and naively) the amount of time until all generations are finished.

This is mostly useful just for halting the terminal until ComfyUI generations are done. Often, I disable sleep mode, then chain 'yara wait' with 'yara melatonin'. This lets me queue up a bunch of generations, and go leave my computer - when ComfyUI is finished running, sleep mode will be re-enabled, so my computer won't be running needlessly. I also might use this to execute other commands once ComfyUI is finished, such as if I want to generate images and train a LorA overnight, but don't want both to be running simultaneously.

As a shorthand, you can use

yara cwm

to disable sleep mode, wait until the queue is empty, and then re-enable sleep mode. (cwm standing for Caffeine/Wait/Melatonin).

Check an Image's Embedded Generation Info

Run

yara image

to start an interactive session. Enter the filepath of an image to obtain the generation data of the image. Model(s), LorA(s), positive prompt text(s), and negative prompt text(s) will be printed to the screen, while the complete generation data will be copied to your clipboard with nice formatting.

(note: you can just drag/drop the image into the terminal window, and it will automatically input the image's filepath).

This is particularly useful since when the workflow isn't embedded into the image (as discussed in the "Saving, Loading, Deleting, and Listing Queues" section above).

Create a Window Displaying the Most Recently Generated Image

If you want to preview the generation output without having the ComfyUI window open, you can run

yara preview

to open an always-on-top window that automatically displays the most recently generated image. Settings to configure the window location/size, or to toggle always-on-top/mouse passthrough and more are available in the config file ('yara config').

Open the Folder Containing the Config File

To open the folder containing the config.json file, run

yara config

Download From CivitAI

To download models/loras/etc from CivitAI, run

yara cai [URLs]

where [URLs] is a space-separated list of the URLs of the CivitAI models/loras/etc It will open a browser window to download them, and will copy the title, URL, filename, keywords, and description to your clipboard.

I mostly use it for the latter feature, as I keep a text file with relevant information for LorAs and this makes it easy to copy/paste all the key info. If you only want to copy the information to your clipboard, without downloading anything, add the '-nd' flag:

yara cai -nd [URLs]

Print Help

To display available commands/arguments, use

yara help

Aliases

Some of the commands can be shortened, for convenience:

Command Alias
save s
load l
delete d
examine e
wait w
caffeine c
melatonin m
preview p
image i
help h

Other

If you have an issue, question, or request for some feature/config option, feel free to make an issue or message me.

This is developed mainly with Windows in mind. There's a Linux release, but it's missing some features (sleep mode toggles) and when I very briefly tested it, the image preview feature didn't work. I mostly use Windows and my time is limited (as is everybody's), so it's not something I'm prioritizing, but if anybody wants to use it on Linux, feel free to make a pull request, a GitHub issue, or just send me a message so I know people are interested in it.

This is built for the latest ComfyUI release binary as of July 22, 2023. Future ComfyUI versions may change the API and thus break parts of this program.

You might also like...
A launcher/menu program written in Rust for wlroots-based Wayland compositors

tehda tehda (ᴛᴀʏ-dah /ˈteɪ̯.dæ/ or /teh.da/; Finnish for "to do, perform, execute") is a launcher/menu program, like dmenu, rofi, or wofi, written in

WIP: A program for switching Dygma layouts based on window name or exe name.

Dygma Layer Switcher Config On the first run of dygma-layer-switcher the config.yml will be generated. --- # Toggle logging. logging: false # Port of

Terminal-based typing test.
Terminal-based typing test.

ttyper Ttyper is a terminal-based typing test built with Rust and tui-rs. installation With Cargo: cargo install ttyper usage For usage instructions,

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Terminal based GUI for eAsistent written in Rust

Terminal based GUI for eAsistent written in Rust This project is currently work in progress. I will update this readme with features that I'm currentl

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Terminal based, feature rich, interactive SQL tool

datafusion-tui (dft) DataFusion-tui provides a feature rich terminal application, built with tui-rs, for using DataFusion (and eventually Ballista). I

YAML(ish) - Terminal UI framework based on templates focused on simplicity
YAML(ish) - Terminal UI framework based on templates focused on simplicity

A YAML(ish) based terminal GUI framework for- and by Rust, focussed on making it quick and easy to create a functional UI for an app or game. Based on Crossterm and inspired by Kivy.

Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.
Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.

Bunt: simple macro-based terminal colors and styles bunt offers macros to easily print colored and formatted text to a terminal. It is just a convenie

Releases(latest-linux)
  • latest-linux(Jul 23, 2023)

    This initial Linux release doesn't have the sleep mode commands implemented ("caffeine"/"melatonin"). When I tested it briefly, the image preview window didn't work, either. Might be other broken features too.

    If you use this program on Linux and would appreciate it being fixed, message me and/or make an issue/pull request.


    To setup:

    In the terminal, navigate to the directory where you downloaded the latest linux release, and then run

    chmod +x yara
    ./yara
    

    Alternatively, in a file browser, right click the "yara" file, go to Properties -> Permissions, and check "Allow executing file as a program". Then run using "./yara" in the terminal.

    After, when running the program, use "./yara [arguments]".

    Source code(tar.gz)
    Source code(zip)
    yara(15.92 MB)
Owner
null
A companion repository for my Rust Talk.

Building a microservice in rust This project is a companion to my talk at ConFoo about building a rust project. You should checkout a fully fleshed ou

Vagmi 4 Feb 27, 2023
A simple program for C program IO testing. Written in Rust

A simple program for C program IO testing. Written in Rust, using concurrency to speed up valgrind testing. Make sure to update settings at your first run of the program!

null 1 Feb 22, 2022
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing

Gest Se 5 Jan 26, 2023
A simple program to show a histogram on the terminal.

A simple program to show a histogram on the terminal.

依云 4 Aug 10, 2021
Cross-platform terminal program to download IEEE journals

IEEE Journal Downloader A cross-platform terminal program which tries to download every article in a specified journal and merge the documents into on

Fong Chien Yoong 18 Jul 23, 2022
A fun rust terminal program so you can make Christmas trees!

Xmastree 2021 A fun christmas tree where you can add ornaments! Then, you can export the file into either: a rust file a txt file About Taking a break

Junhao 2 Dec 21, 2021
A little program written in Rust that prints random PNG images to the terminal in text grabbed from an image repo.

Cermic A little program written in Rust that prints random PNG images to the terminal in text grabbed from an image repo. NOTE: As of right now, Cermi

Jackson Novak 7 Oct 1, 2022
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024