Skip to main content

omnichar-sdk

Read Omnichar Studio .char character files from Python.

A .char holds a character's reference images, its locked description, and often a trained LoRA. This package opens one and hands back those parts. It reads; it never writes.

from omnichar_sdk import Character

char = Character.open("Ada.char")

char.get_description()                       # the locked description
char.get_references(arch="flux2-klein")      # the compiled reference set, in prompt order
char.get_lora()                              # the trained adapter, with a portability verdict
char.get_prompt(style="ordinal")             # text that binds the character to its positions
char.get_voice()                             # the stored voice clip, or None
char.save_reference_sheet("ada.png")         # all the references as one numbered PNG

Reference sheets

reference_sheet() lays the references out in a grid and numbers each cell. The numbers are the point: a position is what a prompt refers to, so a sheet without them cannot be checked against the prompt it belongs to. Pass the same first_position to both and they agree.

char.reference_sheet(arch="flux2-klein", first_position=1)  # a PIL image
char.reference_sheet_png()                                  # PNG bytes
char.save_reference_sheet("out/ada.png")                    # writes it, adds .png if missing

It takes the same arch, role, limit and origin filters as get_references, plus columns, cell, fit, labels and background. It needs the images extra.

Install

pip install omnichar-sdk              # reads everything; needs only the standard library
pip install 'omnichar-sdk[images]'    # adds Pillow, for decoding and resizing references

The base install has no dependencies on purpose. It is meant to drop into ComfyUI, A1111, SwarmUI or a batch job without competing with whatever that host has pinned, so it never converts images to tensors. That belongs to the host.

From a shell

omnichar-sdk inspect Ada.char --json
omnichar-sdk extract Ada.char -o out/
omnichar-sdk prompt Ada.char --style token

inspect --json prints the whole character record, so a tool in any language can read a .char through this command without a Python binding.

Notes

style picks the addressing a model was trained on. FLUX.2 reads ordinal prose, MiniMax H3 reads <Picture N>, Seedance reads @ImageN. description-only drops positions, which is what a LoRA needs. first_position sets the number the first reference gets, so a prompt and a sheet built at the same offset agree about which image is image one.

limit divides the slots between face, body and outfit rather than cutting the end of the list, so a character does not lose its wardrobe when a model takes fewer references than it has.

common_size picks the size a batch is built at and fit resizes onto it: pad letterboxes, cover crops, stretch distorts.

A character's LoRA records the strength it was judged at. An overfitted adapter is only usable turned down, so prefer the recorded value over 1.0.

Building a character

encode_character writes a new .char from (image, role) pairs and compiles a reference set for each architecture, so the result applies without a rebuild:

from omnichar_sdk import encode_character, write

doc = encode_character("Ada", "A woman with short dark hair.", [(face, "face"), (body, "body")])
write("Ada.char", doc)

To give a character a voice, pass two PCM WAV clips: the sample as recorded, and the mono copy a model hears, which needs at least 3 seconds of sound. wanted applies Omnichar's rule for when to send the voice, which is when the prompt has dialogue:

from omnichar_sdk import set_voice, wanted

set_voice(doc, sample_wav, mono_wav, source_name="ada.wav")
if wanted("auto", prompt):
    text = char.get_prompt(style="token", voice_position=1)

It does not compute identity vectors. Those need face encoders this package does not ship, so Omnichar Studio's verify and continuity features stay unavailable until it re-encodes the file. Rendering is unaffected.

Licenses

A .char licensed through Omnichar Cloud carries a reserved.license block. The license module reads it and asks Omnichar whether the user's license secret unlocks it. It never edits the block and never decides validity itself.

from omnichar_sdk import LicenseError, read_license, report_usage, verify

found = read_license(char.manifest)          # None for an unlicensed character
if found is not None:
    try:
        verdict = verify(found, found.char_id, secret, "image", "flux-2-klein", "my-app", "1.0")
    except LicenseError as error:
        print(error)                            # show it; a refusal is the server's own message
    else:
        report_usage(verdict.ticket, "image", "flux-2-klein", "my-app")

verify raises LicenseRefused (with .status and the server's .message), LicenseRateLimited (with .retry_after, never retried) or LicenseUnreachable. All three are LicenseError, which is a CharError. A valid verdict is cached in memory until its ticket runs out, and any refusal clears it, and a cached verdict is reused only while at least two minutes of it remain. report_usage sends from a background thread, retries a few times, then drops the report with one log line; it never raises. Pass license_id and on_refused to hear when Omnichar refuses a ticket, which also clears that license's cached verdicts.

Requests go to https://api.omnichar.org/v1 with the standard library and a 10-second timeout. An lsk_test_ secret selects the sandbox. OMNICHAR_LICENSE_API overrides the address for testing, and only when it names this machine (localhost, 127.0.0.1 or ::1). No URL is ever taken from the .char.

Licence

Apache-2.0. The rest of the repository, including the node pack, is GPL-3.0-or-later.

Metadata

Release files for omnichar-sdk 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omnichar-sdk 0.1.2
File Size Uploaded Provenance Actions
omnichar_sdk-0.1.2.tar.gz 36.3 kB With provenance Details for omnichar_sdk-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omnichar-sdk 0.1.2
File Interpreter ABI Platform Actions
omnichar_sdk-0.1.2-py3-none-any.whl Python 3 none any Details for omnichar_sdk-0.1.2-py3-none-any.whl

Total release size: 80.1 kB

Release files / omnichar_sdk-0.1.2.tar.gz

Download URL omnichar_sdk-0.1.2.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
13e7c1f3a553d00b734ef57287a62ad4365a501acecb9732a22ab520bd214e7f
BLAKE2b-256 checksum
How to use checksums
445ebfbc411555fbe41c6bae050f7a00f6d1f7e13d943b8f8a6a370d9058b96e
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 Nov 15, 2026.

Transparency log

Release files / omnichar_sdk-0.1.2-py3-none-any.whl

Download URL omnichar_sdk-0.1.2-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
308d00a611d5edb09b89f4eea1bd8737836c2115bf3128cc60ec2f8e4434e27a
BLAKE2b-256 checksum
How to use checksums
76b7aa6bc443b24699bcc2767cf3de4085db68a2b646603280c0954ae4f3223e
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 Nov 15, 2026.

Transparency log

Security for omnichar-sdk 0.1.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for omnichar_sdk-0.1.2.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 Nov 15, 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.

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