Commit graph

11 commits

Author SHA1 Message Date
47b5f899e6
fix: use list instead of tuple in extra_params for YAML safety
PyYAML serializes tuples as !!python/tuple tags which safe_load
rejects, corrupting the state file.
2026-03-05 21:21:33 +01:00
770f408dad
feat: ensure image output format matches file extension
All checks were successful
Continuous Integration / Build Package (push) Successful in 30s
Continuous Integration / Lint, Check & Test (push) Successful in 45s
- Add hokusai/image.py with Pillow-based format detection and conversion
- Pass output_format to OpenAI gpt-image models and BFL API
- Convert mismatched images after provider writes (fallback for all providers)
- Handle RGBA-to-RGB flattening for JPEG targets
- Add Pillow dependency
2026-02-21 19:04:33 +01:00
d8e0ed561d
feat: clean up stale targets removed from config on next build
All checks were successful
Continuous Integration / Build Package (push) Successful in 28s
Continuous Integration / Lint, Check & Test (push) Successful in 47s
When a target is present in the state file but no longer in the config,
its output file is deleted (or archived if archive_folder is set) and
its state entry is removed. This runs at the start of every build.
2026-02-21 18:51:39 +01:00
bb03975ece
feat: add content target type for writing literal text to files
All checks were successful
Continuous Integration / Build Package (push) Successful in 43s
Continuous Integration / Lint, Check & Test (push) Successful in 1m1s
Content targets write a string directly to the output file without
invoking any AI provider. They don't require API keys and are not
archived when overwritten.

Example usage in .hokusai.yaml:
  file.txt:
    content: ABC
2026-02-21 18:14:09 +01:00
d76951fe47
feat: add regenerate command to force rebuild of specific targets
The regenerate command accepts one or more target names and forces them
to be rebuilt even if they are up to date. This respects the
archive_folder setting, archiving previous versions before overwriting.
2026-02-21 11:46:07 +01:00
612ea0ae9d
refactor: clean up download target state representation
Download targets now store only 'download: <url>' in the state file
instead of using 'prompt' and 'model: __download__' as a workaround.

Also use exclude_defaults=True when serializing state to omit empty
fields like input_hashes: {} and extra_params: {}.
2026-02-21 11:42:19 +01:00
24cade558a
feat: add archive_folder support for preserving previous generations
When archive_folder is set in the project config, artifacts are moved to
numbered archive copies (e.g. x.01.jpg, x.02.jpg) instead of being
overwritten or deleted.

- Build command archives existing artifacts before rebuilding dirty targets
- Clean command moves files to archive instead of deleting them
- Subfolder structure is preserved in the archive directory
- State file is always deleted, never archived
2026-02-21 11:36:45 +01:00
d22b524182
fix: create parent directories for targets in subfolders
Build targets with subfolder paths (e.g. img/file.jpg) failed because
parent directories did not exist. Create them on demand in
_build_single_target before dispatching to providers.

Also clean up empty subdirectories in the clean command after removing
target files.
2026-02-21 11:21:51 +01:00
3de3614433
feat: add prompt placeholder substitution with {filename} syntax 2026-02-20 21:20:29 +01:00
c1ad6e6e3c
feat: add download target type for fetching files from URLs 2026-02-20 21:20:26 +01:00
4def49350e
chore: rename bulkgen to hokusai
All checks were successful
Continuous Integration / Build Package (push) Successful in 35s
Continuous Integration / Lint, Check & Test (push) Successful in 57s
2026-02-20 17:08:12 +01:00
Renamed from bulkgen/builder.py (Browse further)