Sign In

civitai-sync

60
556
22
Type
Other
Stats
73
Reviews
Published
Oct 29, 2024
Base Model
Other
Hash
AutoV2
D957FA20AA

civitai-sync is a tool to download your Civitai creations.
UPDATE: supports ❀️ favorite / πŸ‘ liked / πŸ‘Ž disliked generations

civtai-sync downloads generations from the Civitai generator. It saves data and media in chronological order, in date-ordered folders. The data is saved as text, so prompts can be searched.

Favorite / liked / disliked generations are saved into separate media folders for quick access, alongside a media folder of all generations. This is configurable. You can also choose to download only data, or only favorite / liked / disliked generations.

Software updates: When a new version is released, you can install it from the program.

See the discussion page, for ideas, issues, new comments: https://civitai.com/articles/5676

You are welcome to leave a comment below, make a review, drop a tip.
Click "Show More" for installation instructions.

The program is a Command Line Interface (CLI). It runs in your computer terminal or command prompt.

Download it

  1. Download the tool from this page. It's a zip file.

  2. On your computer, Unzip (or β€œExtract”) the file. It will create a new folder; rename it β€œcivitai-sync”. Move the folder wherever you want to keep it.

  3. Install Node.js, download it from: https://nodejs.org β€” if you already have Node, it needs version 18 or above.

  4. If you have a nice new shiny clickable Node.js icon on your desktop or menu, don’t click it. You don’t need to. That’s for something else. Do this:

Install it

If updating from an earlier version, see "Manual software update" below.

  1. On Windows, double-click the "install_win" file to install. This will open a command prompt, install the software dependencies and then close. Or, install manually with the steps below.

  2. On Linux, Mac, open your Terminal app.
    On Windows, your β€œCommand Prompt”.

  3. Inside the terminal, change directory (β€œcd”) to the unzipped β€œcivitai-sync” folder. Ensure this matches the name and location on your system. For example:
    cd Downloads/civitai-sync

    On Windows, use backslashes, not forward-slashes:
    cd C:\Downloads\civitai-sync

  4. Install the software dependencies by typing:
    npm install

Run it

Now you can run the program.

On Windows:

  1. Double-click the "Civitai-Sync" file.

  2. To add it as a Desktop shortcut icon, right-click on it > "Send to" > "Desktop (create shortcut)".

On Linux, Mac, or Windows:

  1. In the terminal app, change directory ("cd”) to the program folder, as above.

  2. Run it by typing:
    npm run cli

Manual software update

From v4, software updates are automatically detected. When a new version is released, you will see an option to install the update.

To upgrade from an earlier version:

  1. Download the zip file, unzip it.

  2. Copy the unzipped files into your existing β€œcivitai-sync” program folder, overwriting the older files.

  3. In the terminal app, change directory ("cd”) to the program folder.

  4. Type: β€œnpm install”.
    On Windows, double-click on β€œinstall_win”.

Create an API key

For access to your account, you need a Civitai API key.

  1. In Account Settings, see β€œAPI Keys” near the bottom of the page: https://civitai.com/user/account

  2. Click β€œAdd API key”. Name it, e.g. β€œcivitai-sync”. Click β€œSave”.

  3. You will be shown the key only once > Copy it.

  4. In civitai-sync, choose "Set API key", and paste the key.

(To paste, right-click > "Paste", or press "Ctrl+V" or "Ctrl+Shift+V")

Password protection

You can set a password to encrypt your API key, e.g. if you are on a shared computer. You'll enter the password each time you run the program. Or press "Enter" for no password.

Download generations

When your key is saved, you can choose "Download generations".

See the β€œOptions” to choose which types of generation to download. Downloads are saved inside the program folder in "generations"; you can change this to another directory.

Click β€œLatest” to download your most recent creations. On its first run, everything will be downloaded from the onsite generator. You can choose to download just β€œFavorite/Liked/Disliked” generations.

Generation data

Data from Civitai's API is saved as text files (in β€œJSON” format). You can search the β€œgenerations/data” folder from your file explorer to find specific prompts.

Prompts and metadata are already embedded in the image EXIF data. Some ways to view it:

  1. Chrome browser extension:
    https://chromewebstore.google.com/detail/exif-metadata-viewer/

  2. Stable Diffusion Prompt Reader:
    https://github.com/receyuki/stable-diffusion-prompt-reader

  3. Windows: In Explorer, click on image > properties > select tab with details > select "comments"

Multiple accounts

The program is normally run as:
npm run cli

To download from an alternative account, specify a unique name for it:

npm run cli bob

You will probably want to change the download directory, to be different for each account.

Problems? Thoughts? Get in touch

Make a comment, start a chat.
@monkeypuzzle