Skip to main content

ClipCloud Batch

Bulk AI image generator: a table of prompts in (CSV, Excel, text or pasted rows), a folder of images out. A simple window plus a command line. Runs on your computer. MIT license.

ClipCloud Batch: drop a table, check the rows, see the price, get a folder of images

It uses the ClipCloud API: 35 styles, from $0.0005 per image, and 25 free images a day with a free key.

  • Never pays twice. Stop it, close the laptop, lose Wi-Fi: the next run picks up where it stopped and does not send any row again.
  • Price first. See the cost of the whole table before anything is sent.
  • Free-image planner. With a free key it sends what today's 25 free images cover and keeps the rest for tomorrow. One click continues the batch the next day.
  • Any table. CSV, Excel, TSV, a text file or rows pasted from Google Sheets. Style, count, negative prompt and file name per row. Style names like "Watercolor" or "anime style" and column names in several languages ("Промпт", "Stil") are understood.
  • PNG, JPEG or WebP, plus results.csv with the file, status and cost of every row.

Quick start

pipx install clipcloud-batch

(or pip install clipcloud-batch, or the latest code: pipx install git+https://github.com/alexmrgit/clipcloud-batch. Python 3.9 or newer.)

Get a free key at clipcloud.cliplabs.top/panel or in @clipcloudbot, then:

clipcloud-batch gui

Paste the key in the window, or set it once: export CLIPCLOUD_API_KEY=clip-... (Windows PowerShell: $env:CLIPCLOUD_API_KEY="clip-...").

The window

clipcloud-batch gui opens a page in your browser. It works only on your computer (127.0.0.1).

  1. Prompts. Drop a table or paste prompts, one per line. No table yet? The window has an example to download.
  2. Check the rows. The columns are matched by name; change them if needed, and say whether the first row is a header. Every row shows what will be sent, and skipped rows say why (no prompt, unknown style, a comma without quotes).
  3. Settings. Style for rows without one, images per prompt, format, things to avoid, folder.
  4. Price and start. The price per style, what today's free images cover, and one Start button.

Price and free-image plan

While it works you see each row with its images. Click an image to see it large. Filters show what is done, in progress, waiting or needs attention:

  • blocked by the content filter: not charged; rewrite the prompt in place and send it again;
  • failed: send it again;
  • lost: ClipCloud answered with errors for this job, but it may still finish. Check it again for free; continuing the batch also checks it once more. Sending again may pay twice, so it asks first;
  • uncertain: the request may have reached ClipCloud without an answer, so it may be paid. It is never sent again unless you confirm.

A finished batch

You can close the browser tab: the batch goes on while the program runs. Stopped or waiting batches are listed on the first page with a Continue button, also after a restart.

Unfinished batches on the first page

Command line

clipcloud-batch example                          # write prompts.csv to start from
clipcloud-batch plan prompts.csv                 # price and free-image plan, sends nothing
clipcloud-batch run prompts.csv                  # make the images into "prompts images/"
clipcloud-batch run -o "prompts images"          # continue after a stop, a crash or the next day
clipcloud-batch status "prompts images"          # what happened to each row
clipcloud-batch styles                           # styles, sizes and prices

A real run of 50 rows, stopped with Ctrl+C and started again (shortened):

$ clipcloud-batch run fifty.csv
50 rows, 50 images. Full price $0.025.
  lowquality: 50 images x $0.0005 = $0.025
Send 50 rows? [y/N] y
[20:32:25] row 4 sent
...
[20:32:39] row 51 sent
^C
Stopping. Requests already on the way are allowed to finish (up to two minutes), so their job ids are saved.
Rows: sent 50
Run again to continue: clipcloud-batch run -o "fifty images". Nothing is sent twice.

$ clipcloud-batch run -o "fifty images"
50 rows were sent before and are still being made. They are only checked, not sent again.
[20:33:48] row 7 done -> 0007-a-bowl-of-ramen-soft-morning-light.webp
...
[20:36:33] row 48 done -> 0048-a-rainy-window-at-sunset.webp
Rows: done 50
Spent on this batch: $0.025. Results: fifty images/results.csv

Options for run:

Option What it does
-o folder output folder (default: <table name> images next to the table)
--style HD-HQ style for rows without one
--count 4 images per row when the table has no count column (1 to 10)
--format png webp (as made), png or jpg
--free-only send only what today's free images cover; run again tomorrow for the rest
--max-usd 1 stop sending when the price reaches this sum
--name "{style}/{row}" file name pattern: {row}, {prompt}, {style}
--col style=Look use the column "Look" for the style
--header yes the first row holds column names (no: it is a prompt; default: guessed)
--unknown-style default rows with a style that does not exist get --style instead of being skipped
--post-concurrency 5 requests sent at the same time
-y start without asking

Fixing rows after a run (you decide, nothing is resent on its own):

clipcloud-batch censored images                  # writes censored.csv: fill new_prompt
clipcloud-batch retry images --from images/censored.csv
clipcloud-batch retry images --all-failed        # send failed rows again
clipcloud-batch retry images --all-lost --recheck  # ask about the same jobs again, free
clipcloud-batch retry images --rows 9 --resend-uncertain   # only if you checked: may pay twice

The table

Column names are found automatically (prompt, description, title, style, look, count, negative, filename and similar), or set with --col.

Column What If empty
prompt what to draw the row is skipped
style a ClipCloud style, or a common word like watercolor, photo, pixel art, vertical --style, default HD-HQ
count images for this prompt, 1 to 10 --count, default 1
negative what to avoid --negative
filename file name, may include a folder: cats/tabby 0007-a-red-fox (row and prompt)

A .txt file is one prompt per line (or a table, if its lines have tabs). A CSV without a header row is read as one whole prompt per line, commas included; add a header row to use columns. In Excel files --sheet (or the window) picks the sheet. Save CSV files as "CSV UTF-8". Row numbers are the row numbers you see in Excel. Files that are already in the output folder are never overwritten.

The output folder gets the images, results.csv (row, status, files, cost, job id, error, hint) and .clipcloud-batch.sqlite, the job journal. Keep the journal until the batch is done.

Why not just a script

A loop with requests.post takes a minute to write. These parts take longer, and they are where money gets lost:

  • Nothing is paid twice. Each row is written to the journal before its request goes out, and its job id right after. After a crash the next run only checks jobs that were already started. A request that may have reached the server without an answer is marked "uncertain" and is never sent again on its own. Requests are repeated only when they surely did not leave your computer, or the server said it started nothing. Two programs cannot work on one folder at once.
  • Free-limit planning. A paid balance is used first and free images after it. The planner splits the table by day, and "only free images" keeps each day inside the limit.
  • Polite to the server. About 5 requests at once, up to 50 jobs in progress, a check every 30 seconds. "Too many requests" pauses all sending for a while. When the balance runs out, the key stops working or the connection drops, sending stops and the rest wait.
  • Blocked prompts are marked, not charged, and never resent with the same text.
  • Checked downloads. An error page instead of an image is caught, not saved as a picture.
  • Big tables. Tested with 5,000 rows.

Ways to pay

Route Key Price
direct (default) ClipCloud key clip-... in CLIPCLOUD_API_KEY ClipCloud prices, 25 free a day
apimarket api.market key in API_MARKET_KEY api.market price per image
apify Apify token in APIFY_TOKEN the Apify actor's price, billed by Apify

Pick one with --route apimarket, or in the window (the key dialog also guesses it from the key). --key-file path reads the key from a file. The window can remember a key in ~/.config/clipcloud-batch/keys.json, stored in plain text in your user folder. On Apify each style has its price tier (draft, basic, HD, Full HD, 4K) plus a small fee per run.

Good to know

  • Jobs take 1 to 15 minutes, bigger styles longer. Rows run in parallel: 50 rows took about 4 minutes in our test.
  • Image links from the API are temporary, so images are downloaded as soon as they are ready.
  • A job that is not ready after 30 minutes is marked "still not ready". Continuing the batch checks it again (--max-wait changes the limit).
  • Free images go into a slower queue than paid ones.
  • English prompts work best.
  • On a server without a screen: clipcloud-batch gui --port 8765 --no-browser there, then ssh -L 8765:127.0.0.1:8765 server on your computer and open http://127.0.0.1:8765/.
  • CLIPCLOUD_BASE_URL sets another API address, for example the mirror https://clipcloud-rumirror.clipai.pro.
  • ClipCloud developers can add their developer id (soft_id) with --soft-id N or CLIPCLOUD_SOFT_ID. Nothing is sent by default.

Development

python -m venv .venv && .venv/bin/pip install -e ".[test]"
.venv/bin/pytest

The tests use a fake API, no key needed. Code map: journal.py (row states in SQLite), runner.py (the queue), routes.py (direct, api.market, Apify), planner.py (price and free days), table.py (reading tables), gui.py and gui.html (the window).

License: MIT.

Metadata

Release files for clipcloud-batch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipcloud-batch 0.1.0
File Size Uploaded Provenance Actions
clipcloud_batch-0.1.0.tar.gz 95.6 kB Without provenance Details for clipcloud_batch-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clipcloud-batch 0.1.0
File Interpreter ABI Platform Actions
clipcloud_batch-0.1.0-py3-none-any.whl Python 3 none any Details for clipcloud_batch-0.1.0-py3-none-any.whl

Total release size: 172.2 kB

Release files / clipcloud_batch-0.1.0.tar.gz

Download URL clipcloud_batch-0.1.0.tar.gz
Size 95.6 kB
Tags Source
SHA-256 checksum
How to use checksums
74ee96c854ab1b521ef4ba20c1d8b447c0706a869af130c9c0eee000aaef3850
BLAKE2b-256 checksum
How to use checksums
29ff34f1e8dd7549372dbdeb5f8f67d67ad76edb8455a4c529fe677f5cb74d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / clipcloud_batch-0.1.0-py3-none-any.whl

Download URL clipcloud_batch-0.1.0-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
025166d53e2d72cd1f78ead33de464d3ec7edf3524e100c692c34d7aaf069ded
BLAKE2b-256 checksum
How to use checksums
b826c205700c88f6078092095eb6a736eba7d6b2accd4271bfb0cfc5e583ab1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for clipcloud-batch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page