Skip to main content

kohakugbc-data

The data side of KohakuGBC (Graph-Based Captioning), without the captioning machine: GBC graphs (store, resolution, prompt rendering) and the GBC dataset format. Depends on numpy, pillow, pyarrow and kohakuvault only; one wheel per platform for CPython 3.11+.

pip install kohakugbc-data

Graphs

from kohakugbc_data import GbcGraph

g = GbcGraph.from_json(line)  # one GBC graph (ml-gbc JSON), or from_msgpack
blob = g.to_msgpack()  # typed msgpack + zstd: ~7.6x smaller than JSON
g = GbcGraph.from_msgpack(blob)
text = g.prompt(width=1024, height=1024)  # the GBC prompt text (boxes in MOSS layout space)

GbcGraph.prompt / prompt_dag render natively; kohakugbc_data.prompt holds the Python renderers (from_gbc, render, parse, to_moss for the MOSS-Image layout draft, detail levels in kohakugbc_data.prompt.detail), equal to the native ones.

Datasets

A GBC dataset: images, graphs and a metadata dict per image, joined by a sample key, in self-contained shards.

<root>/dataset.json             format, version, the shard list, the dataset header
<root>/shards/shard_XXXXX/
    images.zip                  KohakuClip image shard: stored zip + __index__.bin
    graphs.db                   KohakuVault "graphs": key -> GbcGraph msgpack (zstd)
    meta.db                     KohakuVault "meta": key -> dict (any content)
    manifest.parquet            key, index, w, h, codec, sizes, extra columns
from kohakugbc_data.dataset import DatasetWriter, GbcDataset, read_info, split

ds = GbcDataset(root, image="pil")  # or "bytes" / None; graphs=, meta=, shards=
s = ds[0]  # or ds["<key>"]: key, w, h, codec, image, graph, meta
ds = GbcDataset(root, transform=lambda s: (s.image, s.graph.prompt(width=s.w, height=s.h)))

with DatasetWriter(out, shard_bytes=4 << 30, header={"name": "my-set"}) as w:
    w.add(key, image_bytes, width, height, "webp", graph_line, {"tags": tags})

images.zip is byte-identical to what KohakuClip writes for the same images, so kohakuclip.ImageReader reads it directly. Shards close at shard_bytes and / or per_shard; distributed jobs take whole shards (split(names, rank, world)). The full format: docs/guides/dataset.md.

License

Apache-2.0.

Metadata

Release files for kohakugbc-data 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 kohakugbc-data 0.1.0
File Size Uploaded Provenance Actions
kohakugbc_data-0.1.0.tar.gz 49.8 kB With provenance Details for kohakugbc_data-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kohakugbc-data 0.1.0
File Actions
kohakugbc_data-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for kohakugbc_data-0.1.0-cp311-abi3-win_amd64.whl
kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
kohakugbc_data-0.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for kohakugbc_data-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
kohakugbc_data-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for kohakugbc_data-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 7.4 MB

Release files / kohakugbc_data-0.1.0.tar.gz

Download URL kohakugbc_data-0.1.0.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
420aa0551fbceb954d9fa8905da44a38e82b5cb9cc6addcaf84451bb4080defe
BLAKE2b-256 checksum
How to use checksums
08a4b02cc24c4945831db2c2f4b70927f1d9e61db25c2e2bf1789639447262ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / kohakugbc_data-0.1.0-cp311-abi3-win_amd64.whl

Download URL kohakugbc_data-0.1.0-cp311-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ab53b438d93fbb2d0836b27d536eccf5c7e0d4aa67104cbb89b9f95a0cced752
BLAKE2b-256 checksum
How to use checksums
bc984ff9f830dad7ac33bc904b54869bc3f29d29bd87ee13af25447b698ad745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b152632750701dca35f982868de4f880dfd316ecdaac7b3f9b73fb9f34bc0139
BLAKE2b-256 checksum
How to use checksums
db155d71b535dd075a9ae46a6d84739b6a638f06f399854ad3090e793b0b4474
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL kohakugbc_data-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
ac8a61b36446b76f8a29178c9848c8e6da4670af1f8a22fddfc0fdba3941cba5
BLAKE2b-256 checksum
How to use checksums
1699f8343a8efca1687a0f154eb5ee2e74205f922b1ce3cba275754212e6a822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / kohakugbc_data-0.1.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL kohakugbc_data-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d08c1caaffd35dce9e57aa4984841b255132db06d197882def0e4f5bc65b73c5
BLAKE2b-256 checksum
How to use checksums
00ac72b38dde9b5f5bb4a66a6943c6fce8e6891633718a60d908bfb32dd60f17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / kohakugbc_data-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL kohakugbc_data-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8b7da56dd11cb63a4e8779933831f7bdec743479ec23618d7a154e4d27c26e7a
BLAKE2b-256 checksum
How to use checksums
f43e63f378026ba2486ed26171cd72384f08b58a344763fee101ea9230f9e1e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for kohakugbc-data 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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for kohakugbc_data-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

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

6 release files Full 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