CLI for generating nano banana images through GRSAI
Project description
nbdraw
nbdraw is a Python CLI for generating images with GRSAI nano banana models.
nbdraw 是一个用于调用 GRSAI nano banana 模型进行绘图的 Python 命令行工具。
Features / 特性
nbdraw drawcommand for image generation- Config priority: file < env < CLI
- Auto download to
./outputsby default - JSON output for script integration
- Backward-compatible
grsai_draw.pyentry
Install / 安装
pipx (recommended)
pipx install nbdraw
pip
pip install nbdraw
Quick Start / 快速开始
- Copy example config to project root.
- Set API key by file/env/CLI.
- Run draw command.
cp examples/nbdraw.toml ./nbdraw.toml
nbdraw draw --prompt "professional flat vector architecture diagram"
Default outputs:
task_id- image
url - downloaded file
local_pathunder./outputs
Configuration / 配置
Default search order:
--config <path>if provided./nbdraw.toml
Examples shipped in this repo:
examples/nbdraw.toml
Example config:
[client]
base_url = "https://grsaiapi.com"
api_key = "sk-YOUR_API_KEY"
[draw]
model = "nano-banana-pro-vip"
aspect_ratio = "16:9"
image_size = "2K"
[poll]
interval = 5.0
max_wait = 300.0
heartbeat = 15.0
Environment variables:
GRSAI_API_KEYGRSAI_BASE_URL
CLI Examples / 命令示例
# Use prompt file
nbdraw draw --prompt-file prompt.md
# Use stdin
cat prompt.md | nbdraw draw --stdin
# Dry run payload only
nbdraw draw --prompt "test" --dry-run
# JSON output
nbdraw draw --prompt "test" --json
# Disable local download
nbdraw draw --prompt "test" --no-download
Backward Compatibility / 向后兼容
Old command still works:
python grsai_draw.py --prompt "test"
It calls the new implementation and prints a deprecation notice.
Development / 开发
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
ruff check .
pytest
python -m build
Or use conda:
conda activate nbdraw
pip install -e '.[dev]'
ruff check .
pytest
python -m build
CI & Release
- CI: lint + tests + package build
- Release: push tag
v*to trigger PyPI publish via GitHub Actions Trusted Publisher
Migration Notes / 迁移说明
- Keep old options unchanged where possible.
- Recommended config:
cp examples/nbdraw.toml ./nbdraw.toml
- New options:
--output-dir--no-download--json
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbdraw-0.1.1.tar.gz.
File metadata
- Download URL: nbdraw-0.1.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646d4a1f1acb2f2f834bf89a182fe20693237ef1aa7817cee7d2402a71da0b72
|
|
| MD5 |
cb1478fad748deb592e0711b7d029ca4
|
|
| BLAKE2b-256 |
cb5df29c1be31f747b0ec36e2a735a3f60320e18967d0afeacf474dfbcd997b4
|
Provenance
The following attestation bundles were made for nbdraw-0.1.1.tar.gz:
Publisher:
release.yml on yiz-hhh/nbdraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdraw-0.1.1.tar.gz -
Subject digest:
646d4a1f1acb2f2f834bf89a182fe20693237ef1aa7817cee7d2402a71da0b72 - Sigstore transparency entry: 992474356
- Sigstore integration time:
-
Permalink:
yiz-hhh/nbdraw@4f3017a712aaa57d73da948b0f6fbf08c5c2a73c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yiz-hhh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f3017a712aaa57d73da948b0f6fbf08c5c2a73c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nbdraw-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nbdraw-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1552e36afbb47449952e40d0176fe6cd7d3ec7cca6b4aa1adec0e4874e2f744b
|
|
| MD5 |
d88c73fbd75fba28acc38f89ed946fb8
|
|
| BLAKE2b-256 |
5ae895842f9a7d44c5420f7d2c83a337ce4454e8eae9fa40aa5cf47da97e9a34
|
Provenance
The following attestation bundles were made for nbdraw-0.1.1-py3-none-any.whl:
Publisher:
release.yml on yiz-hhh/nbdraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdraw-0.1.1-py3-none-any.whl -
Subject digest:
1552e36afbb47449952e40d0176fe6cd7d3ec7cca6b4aa1adec0e4874e2f744b - Sigstore transparency entry: 992474370
- Sigstore integration time:
-
Permalink:
yiz-hhh/nbdraw@4f3017a712aaa57d73da948b0f6fbf08c5c2a73c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yiz-hhh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f3017a712aaa57d73da948b0f6fbf08c5c2a73c -
Trigger Event:
push
-
Statement type: