spriterrific 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spriterrific/__init__.py +5 -0
- spriterrific/action_batch.py +103 -0
- spriterrific/anchor_wizard.py +1700 -0
- spriterrific/anchor_wizard_gui.py +1022 -0
- spriterrific/anchors.py +332 -0
- spriterrific/api.py +307 -0
- spriterrific/assets/guides/alternating-1024x1024.png +0 -0
- spriterrific/bootstrap_anchors.py +489 -0
- spriterrific/bria.py +154 -0
- spriterrific/cells.py +39 -0
- spriterrific/chroma.py +662 -0
- spriterrific/cli.py +980 -0
- spriterrific/commands.py +106 -0
- spriterrific/events.py +22 -0
- spriterrific/finalize_runtime.py +217 -0
- spriterrific/frame_aligner.py +611 -0
- spriterrific/frame_clean.py +147 -0
- spriterrific/frame_picker.py +869 -0
- spriterrific/frame_sheet.py +220 -0
- spriterrific/guides.py +12 -0
- spriterrific/manifest.py +38 -0
- spriterrific/media.py +628 -0
- spriterrific/pack.py +41 -0
- spriterrific/paths.py +244 -0
- spriterrific/pipeline.py +1609 -0
- spriterrific/pixel_snap.py +184 -0
- spriterrific/post_selection.py +1104 -0
- spriterrific/preprocess.py +109 -0
- spriterrific/presets.py +548 -0
- spriterrific/prompts.py +510 -0
- spriterrific/review_index.py +301 -0
- spriterrific/runids.py +14 -0
- spriterrific/runtime_tools/__init__.py +0 -0
- spriterrific/runtime_tools/animated_spritesheets/__init__.py +0 -0
- spriterrific/runtime_tools/animated_spritesheets/scripts/__init__.py +0 -0
- spriterrific/runtime_tools/animated_spritesheets/scripts/build_contact_sheet.py +81 -0
- spriterrific/runtime_tools/animated_spritesheets/scripts/build_sequence_gif.py +60 -0
- spriterrific/runtime_tools/animated_spritesheets/scripts/make_alternating_sheet.py +42 -0
- spriterrific/runtime_tools/animated_spritesheets/scripts/normalize_frames.py +63 -0
- spriterrific/runtime_tools/fal_ai_image/__init__.py +0 -0
- spriterrific/runtime_tools/fal_ai_image/assets/model-presets.json +140 -0
- spriterrific/runtime_tools/fal_ai_image/scripts/__init__.py +0 -0
- spriterrific/runtime_tools/fal_ai_image/scripts/_fal_common.py +271 -0
- spriterrific/runtime_tools/fal_ai_image/scripts/fal_queue_image_run.py +408 -0
- spriterrific/runtime_tools/fal_ai_video/__init__.py +0 -0
- spriterrific/runtime_tools/fal_ai_video/assets/model-presets.json +164 -0
- spriterrific/runtime_tools/fal_ai_video/scripts/__init__.py +0 -0
- spriterrific/runtime_tools/fal_ai_video/scripts/_fal_common.py +283 -0
- spriterrific/runtime_tools/fal_ai_video/scripts/fal_queue_video_run.py +410 -0
- spriterrific/runtime_tools/gamedev_assets/__init__.py +0 -0
- spriterrific/runtime_tools/gamedev_assets/scripts/__init__.py +0 -0
- spriterrific/runtime_tools/gamedev_assets/scripts/asset_sprite_baseline.py +187 -0
- spriterrific/runtime_tools/pixel_snapper/__init__.py +0 -0
- spriterrific/runtime_tools/pixel_snapper/scripts/__init__.py +0 -0
- spriterrific/runtime_tools/pixel_snapper/scripts/pixel_snapper.py +483 -0
- spriterrific/scale.py +83 -0
- spriterrific/sheet_guides.py +43 -0
- spriterrific/size_contract.py +374 -0
- spriterrific/skill_install.py +77 -0
- spriterrific/skills/spriterrific/SKILL.md +729 -0
- spriterrific/skills/spriterrific/references/happy-path-prompt-templates.md +299 -0
- spriterrific/skills/spriterrific/references/image-action-pose-boards.md +102 -0
- spriterrific/skills/spriterrific/references/seven-step-ai-prompting.md +228 -0
- spriterrific/sprite_cleanup.py +526 -0
- spriterrific/validate.py +33 -0
- spriterrific/web/app.js +217 -0
- spriterrific/web/index.html +161 -0
- spriterrific/web/styles.css +367 -0
- spriterrific-0.9.0.dist-info/METADATA +488 -0
- spriterrific-0.9.0.dist-info/RECORD +74 -0
- spriterrific-0.9.0.dist-info/WHEEL +5 -0
- spriterrific-0.9.0.dist-info/entry_points.txt +2 -0
- spriterrific-0.9.0.dist-info/licenses/LICENSE +21 -0
- spriterrific-0.9.0.dist-info/top_level.txt +1 -0
spriterrific/__init__.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from .pipeline import RunOptions, run_pipeline
|
|
7
|
+
from .presets import get_action
|
|
8
|
+
from .review_index import ReviewAsset, write_review_index
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True)
|
|
12
|
+
class ActionBatchOptions:
|
|
13
|
+
actions: tuple[str, ...]
|
|
14
|
+
direction: str
|
|
15
|
+
reference: Path
|
|
16
|
+
run_dir: Path
|
|
17
|
+
mode: str = "image"
|
|
18
|
+
existing_sheet_root: Path | None = None
|
|
19
|
+
dry_fal: bool = False
|
|
20
|
+
pixel_snap: bool = False
|
|
21
|
+
pixel_snap_source: str = "recovered"
|
|
22
|
+
k_colors: int = 256
|
|
23
|
+
chroma: str = "#00FF00"
|
|
24
|
+
pose_board_preset: str = "standard"
|
|
25
|
+
frame_prompt_style: str = "specific"
|
|
26
|
+
green_fringe_cleanup: bool = True
|
|
27
|
+
green_fringe_min_green: int = 70
|
|
28
|
+
green_fringe_dominance: int = 24
|
|
29
|
+
green_fringe_edge_radius: int = 1
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def run_action_batch(options: ActionBatchOptions) -> list[Path]:
|
|
33
|
+
if not options.actions:
|
|
34
|
+
raise ValueError("at least one action is required")
|
|
35
|
+
|
|
36
|
+
outputs = []
|
|
37
|
+
for action in options.actions:
|
|
38
|
+
get_action(action)
|
|
39
|
+
run_dir = options.run_dir / f"{action}-{options.direction}"
|
|
40
|
+
existing_sheet = None
|
|
41
|
+
if options.existing_sheet_root is not None:
|
|
42
|
+
existing_sheet = options.existing_sheet_root / f"{action}-{options.direction}" / "generated" / "sheet.png"
|
|
43
|
+
paths = run_pipeline(
|
|
44
|
+
RunOptions(
|
|
45
|
+
action=action,
|
|
46
|
+
direction=options.direction,
|
|
47
|
+
reference=options.reference,
|
|
48
|
+
run_dir=run_dir,
|
|
49
|
+
mode=options.mode,
|
|
50
|
+
dry_fal=options.dry_fal,
|
|
51
|
+
existing_sheet=existing_sheet,
|
|
52
|
+
pixel_snap=options.pixel_snap,
|
|
53
|
+
pixel_snap_source=options.pixel_snap_source,
|
|
54
|
+
k_colors=options.k_colors,
|
|
55
|
+
chroma=options.chroma,
|
|
56
|
+
pose_board_preset=options.pose_board_preset,
|
|
57
|
+
frame_prompt_style=options.frame_prompt_style,
|
|
58
|
+
green_fringe_cleanup=options.green_fringe_cleanup,
|
|
59
|
+
green_fringe_min_green=options.green_fringe_min_green,
|
|
60
|
+
green_fringe_dominance=options.green_fringe_dominance,
|
|
61
|
+
green_fringe_edge_radius=options.green_fringe_edge_radius,
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
outputs.append(paths.root)
|
|
65
|
+
|
|
66
|
+
_write_action_batch_review(options.run_dir, outputs)
|
|
67
|
+
return outputs
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _write_action_batch_review(run_dir: Path, action_dirs: list[Path]) -> Path:
|
|
71
|
+
assets: list[ReviewAsset] = []
|
|
72
|
+
for action_dir in action_dirs:
|
|
73
|
+
label = action_dir.name
|
|
74
|
+
assets.extend(
|
|
75
|
+
[
|
|
76
|
+
ReviewAsset(
|
|
77
|
+
f"{label} Pixel Snap To Runtime Comparison",
|
|
78
|
+
action_dir / "review" / "compare-04-pixel-snap-to-runtime.png",
|
|
79
|
+
"Frame-by-frame recovered/source/pixel-snap/runtime comparison for the action.",
|
|
80
|
+
True,
|
|
81
|
+
),
|
|
82
|
+
ReviewAsset(
|
|
83
|
+
f"{label} Runtime Preview",
|
|
84
|
+
action_dir / "review" / "preview.gif",
|
|
85
|
+
"Final normalized 256x256 runtime preview.",
|
|
86
|
+
True,
|
|
87
|
+
),
|
|
88
|
+
ReviewAsset(
|
|
89
|
+
f"{label} Detailed Review",
|
|
90
|
+
action_dir / "review" / "index.md",
|
|
91
|
+
"Detailed per-action review page.",
|
|
92
|
+
False,
|
|
93
|
+
),
|
|
94
|
+
]
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
existing = [asset for asset in assets if asset.path.exists()]
|
|
98
|
+
return write_review_index(
|
|
99
|
+
run_dir / "review",
|
|
100
|
+
title=f"{run_dir.name} Review",
|
|
101
|
+
summary="Top-level review for a multi-action Spriterrific run.",
|
|
102
|
+
assets=existing,
|
|
103
|
+
)
|