aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: ff3cec05db6802be52e42fd1faf30d4137617d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# fanfictioner

Turn a story idea into a text-free illustrated book. A local Gemma model
(llama-server) plans the pages and writes the image prompts; `sd-cli`
(stable-diffusion.cpp) draws them. You pick among three candidates at every
image stage. Pages land in the book-reader library as `NNN.png`.

## Requirements

- Python 3, stdlib only
- llama-server in router mode on `localhost:8181` serving `Gemma4-12B-qat-mtp`
- `sd-cli` with Vulkan, models under `/data/LLM-models/SD`
- ImageMagick 7 (`magick`), kitty (`kitty +kitten icat`), `$EDITOR`
- `~/.config/book-reader.conf` with a `LIBRARY="..."` line

## Usage

A story file is free prose. An optional frontmatter at the top sets the names
instead of letting Gemma invent them; every key is optional:

    ---
    series: A new life
    book: Life as Daniel
    chapter: 1
    title: Meet Daniel
    ---

`series` and `book` name the library folders, `title` is the lettering on the
chapter's page 1. With `chapter`, pages are saved as
`01-001.png`, `01-002.png`, so every chapter of a book (one story file each)
reads as one continuous book in book-reader. These values always override what
Gemma writes in plan.md.

    fanfictioner story.md [--base zimage|krea2]
    fanfictioner --selftest

Work files go to a directory named after the story (`stories/rooftop.md` ->
`stories/rooftop/`): `plan.md`, `plan.json`, `refs/`, `cand/` and `run.log`.
`run.log` records every generation, pick (with its seed), regeneration, prompt
edit, skip and plan decision with a timestamp. Each sd-cli call also leaves its
own log next to its candidates in `cand/`. Quit any time
with `q` or Ctrl-C; the next run resumes from what is on disk.

Plan review keys: `c` confirm, `e` edit in `$EDITOR`, `g` ask Gemma to revise,
`q` quit. Image review keys: `1`-`3` pick, `r` regenerate, `p` edit prompt,
`s` skip edit (edit stage only), `q` quit.

Page 1 is the cover: its `Title:` line in plan.md is drawn as title lettering,
the only text in the book. Remove the line for a cover without text. A page can
override the base model with a `Model: krea2` line in plan.md. To
redo a page, delete `NNN.png` from the library and its `cand/pNNN_*` folder.
To redo a reference sheet, delete `refs/<Name>.png`; pages already done keep
the old look. A prompt edited with `p` applies until you pick and is not
written back to plan.json.

## License

Copyright (C) 2026 Danilo M. <danix@danix.xyz>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the Free
Software Foundation. See `LICENSE`.

## Development Approach

This project is developed using AI-assisted tools. Code is generated with the help of AI based on human-provided specifications, design decisions, and iterative feedback.

All contributions are reviewed, tested, and curated by the maintainer before being included in the codebase. AI is used as a productivity and exploration tool, while human oversight remains central to all decisions.

The goal is to combine the flexibility of AI-assisted development with standard open-source practices such as transparency, review, and accountability.