Skip to content

Conversation

@rambling-ai
Copy link

What this changes

Currently, any existing caption files will cause the already-captioned image to be skipped. This PR add an argument that allows you to override that default in one of three ways. It adds a --no-skip argument with options for overwrite, append, and prepend.

There are existing arguments --append and --prepend that allow you to add a trigger word, character tag, etc. to the generated captions. But what if you have multiple concepts in the same batch?

With this added feature you can pre-label your dataset however you like, and then use Joycaption to add additional information.

Usage

--no-skip overwrite
Destructively overwrites existing captions. Useful if you are tweaking a prompt and don't care about the previous output.

--no-skip append
Keeps the current caption file and adds the generated caption to the end of the previous caption.

--no-skip prepend
Keeps the current caption file and adds the generated caption before the previous caption.

When using the append and prepend modes, the first part will be trimmed for whitespace. If it doesn't already end in a period a period will be added, and then a space will be added before the second part.

Examples

  • Existing caption: square_red_XL
  • New caption: A photograph of a large platter on a white table cloth. The platter has a square shape. It is red with a striped pattern.
  • append output: square_red_XL. A photograph of a large platter on a white table cloth. The platter has a square shape. It is red with a striped pattern.
  • prepend output: A photograph of a large platter on a white table cloth. The platter has a square shape. It is red with a striped pattern. square_red_XL
  • overwrite output: A photograph of a large platter on a white table cloth. The platter has a square shape. It is red with a striped pattern.

@rambling-ai rambling-ai marked this pull request as ready for review June 27, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants