Skip to content

Commit cd7666e

Browse files
authored
feat: add texture delight generation option (#8)
* feat: add texture delight generation option * docs: clarify public CLI login guidance
1 parent 0a67975 commit cd7666e

13 files changed

Lines changed: 49 additions & 34 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ to `packages/cli/dist`. Tests exercise the compiled JavaScript. The build copies
3333
contract JSON into the artifact; consumers do not need TypeScript or install
3434
scripts. Do not commit `dist`.
3535

36-
ESLint and Prettier follow the Hyper3D backend configuration: 80-column formatting,
36+
ESLint and Prettier enforce 80-column formatting,
3737
single quotes, trailing commas, sorted import groups, unused-import checks and
38-
type-aware promise rules. NestJS-specific rules do not apply to this CLI.
38+
type-aware promise rules.
3939
`npm run lint:fix` fixes lint issues; `npm run format:check` checks formatting
4040
without changing files. Tests and maintenance scripts are linted as JavaScript.
4141

‎README.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,22 @@ hyper3d generate --prompt "a ceramic teapot" --format glb
6161
# From one image
6262
hyper3d generate --image ./reference.png
6363

64+
# For reference images with highly reflective surfaces
65+
hyper3d generate --image ./reference.png --texture-delight
66+
6467
# From multiple views, with an optional description
6568
hyper3d generate --image ./front.png --image ./side.jpg --prompt "a ceramic teapot"
6669
```
6770

6871
Provide a prompt, one to five images, or both. Generation options:
6972

70-
| Option | Accepted values | Default when omitted |
71-
| ------------- | -------------------------------------------------------------- | ---------------------------- |
72-
| `--tier` | `Gen-2.5-Medium`, `Gen-2.5-High`, `Gen-2.5-Extreme-Low` | `Gen-2.5-Medium` |
73-
| `--mesh-mode` | `Raw`, `Quad` | `Raw` |
74-
| `--format` | `glb`, `usdz`, `fbx`, `obj`, `stl` | `glb` |
75-
| `--quality` | Target polygon count: Raw `500–1,000,000`; Quad `1,000–50,000` | Raw `500,000`; Quad `18,000` |
73+
| Option | Accepted values | Default when omitted |
74+
| ------------------- | ----------------------------------------------------------------------- | ---------------------------- |
75+
| `--tier` | `Gen-2.5-Medium`, `Gen-2.5-High`, `Gen-2.5-Extreme-Low` | `Gen-2.5-Medium` |
76+
| `--mesh-mode` | `Raw`, `Quad` | `Raw` |
77+
| `--format` | `glb`, `usdz`, `fbx`, `obj`, `stl` | `glb` |
78+
| `--quality` | Target polygon count: Raw `500–1,000,000`; Quad `1,000–50,000` | Raw `500,000`; Quad `18,000` |
79+
| `--texture-delight` | Flag: enable texture de-lighting for highly reflective reference images | `false` |
7680

7781
Defaults are applied by the server. The response includes a generation ID; use
7882
it in place of `<generation-id>` to check progress and retrieve the result:

‎docs/architecture.md‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
## Authentication and CIMD
44

55
The CLI uses OAuth Device Flow for every interactive login. Its public CIMD
6-
client ID is `https://hyper3d.ai/oauth_cimd/cli.json`. Deploy the JSON in
7-
`oauth_cimd/cli.json` at that exact URL, anonymously with
8-
`Content-Type: application/json`. It declares Device Flow and refresh-token
6+
client ID is `https://hyper3d.ai/oauth_cimd/cli.json`. The public metadata declares
7+
Device Flow and refresh-token
98
grants, with empty `redirect_uris` and `response_types`. No client secret or
109
localhost callback is used. Publishing CIMD does not publish the CLI to npm.
1110

@@ -17,18 +16,14 @@ npm run cli -- auth logout
1716
```
1817

1918
Login prints a code and opens the returned `verification_uri_complete` URL.
20-
The backend then redirects the browser to
21-
`https://hyper3d.ai/workspace/oauth/device?interaction=<handle>`.
22-
The CLI uses the returned verification URL, not a hardcoded frontend URL.
19+
The CLI follows the returned verification URL.
2320
The user confirms that the browser code matches the terminal, then authorizes
2421
the CLI. `--no-browser` only prints the link/code for SSH or another device.
2522
Failure to launch the browser leaves the same login waiting for manual approval.
2623
The CLI polls until success, denial or device-code expiry and handles polling
2724
backoff. Ctrl+C cancels login. Login never falls back to authorization-code/PKCE.
2825

29-
Deploy the backend Device Flow support, frontend device confirmation page and
30-
updated CIMD, and add the exact client ID to `grant.device_flow_client_ids`
31-
before using this against production. The CLI fails explicitly when the server
26+
The CLI fails explicitly when the service
3227
does not advertise Device Flow. Existing MCP clients retain their own login flows.
3328

3429
The SDK handles OAuth discovery, resource validation and subsequent token
@@ -53,8 +48,8 @@ the default output says the user is not authenticated; `--output json` returns
5348
explicitly rather than reporting a verified login.
5449

5550
The CLI explicitly requests `rodin:generate rodin:read account:read offline_access`;
56-
it never requests every scope advertised by discovery. Deploy backend support for
57-
`account:read` and the updated official CIMD before using account lookup. Existing
51+
it never requests every scope advertised by discovery. Account lookup requires
52+
the `account:read` permission. Existing
5853
users must run `hyper3d auth login` again to grant the new permission. Refreshing
5954
an older grant does not add scopes. Existing MCP tool permissions and the public
6055
MCP discovery scope list remain unchanged.
@@ -99,7 +94,7 @@ integer timeout in seconds. It automatically chains wait-tool calls of at most
9994

10095
Every MCP HTTP request includes `X-Hyper3D-CLI-Version`, read from the CLI's
10196
package version, matching the version sent in MCP initialization `clientInfo`.
102-
This lets the stateless backend read the CLI version on individual tool calls;
97+
This identifies the CLI version on individual tool calls;
10398
the OAuth `client_id` remains unchanged.
10499

105100
## CLI layers
@@ -121,8 +116,8 @@ the live server schema.
121116

122117
`src/base_schema.json` is the single bundled reference snapshot of the public
123118
production tool list. It contains 7 tools and their input/output schemas, without
124-
schema versions or implementation adapters. Backend compatibility is handled by
125-
the backend; the CLI has one implementation of each operation.
119+
schema versions or implementation adapters. The CLI has one implementation of
120+
each operation.
126121

127122
Actual requests are validated against the live server schema. Differences from
128123
the base input schema warn but do not reject input accepted by the server.

‎docs/releasing.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,5 @@ do not republish or move an existing tag. An already-existing stable tag also
100100
blocks publication before npm is changed. A rerun of a beta workflow gets a new
101101
attempt suffix, provided its planned version is still above main and latest.
102102

103-
Before releasing, verify the deployed Device Flow and official CIMD client metadata.
104-
See [architecture.md](architecture.md) for the backend integration contract.
103+
Before releasing, verify CLI login using Device Flow and the public CIMD client metadata.
104+
See [architecture.md](architecture.md) for authentication and compatibility details.

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/cli/README.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,22 @@ hyper3d generate --prompt "a ceramic teapot" --format glb
6161
# From one image
6262
hyper3d generate --image ./reference.png
6363

64+
# For reference images with highly reflective surfaces
65+
hyper3d generate --image ./reference.png --texture-delight
66+
6467
# From multiple views, with an optional description
6568
hyper3d generate --image ./front.png --image ./side.jpg --prompt "a ceramic teapot"
6669
```
6770

6871
Provide a prompt, one to five images, or both. Generation options:
6972

70-
| Option | Accepted values | Default when omitted |
71-
| ------------- | -------------------------------------------------------------- | ---------------------------- |
72-
| `--tier` | `Gen-2.5-Medium`, `Gen-2.5-High`, `Gen-2.5-Extreme-Low` | `Gen-2.5-Medium` |
73-
| `--mesh-mode` | `Raw`, `Quad` | `Raw` |
74-
| `--format` | `glb`, `usdz`, `fbx`, `obj`, `stl` | `glb` |
75-
| `--quality` | Target polygon count: Raw `500–1,000,000`; Quad `1,000–50,000` | Raw `500,000`; Quad `18,000` |
73+
| Option | Accepted values | Default when omitted |
74+
| ------------------- | ----------------------------------------------------------------------- | ---------------------------- |
75+
| `--tier` | `Gen-2.5-Medium`, `Gen-2.5-High`, `Gen-2.5-Extreme-Low` | `Gen-2.5-Medium` |
76+
| `--mesh-mode` | `Raw`, `Quad` | `Raw` |
77+
| `--format` | `glb`, `usdz`, `fbx`, `obj`, `stl` | `glb` |
78+
| `--quality` | Target polygon count: Raw `500–1,000,000`; Quad `1,000–50,000` | Raw `500,000`; Quad `18,000` |
79+
| `--texture-delight` | Flag: enable texture de-lighting for highly reflective reference images | `false` |
7680

7781
Defaults are applied by the server. The response includes a generation ID; use
7882
it in place of `<generation-id>` to check progress and retrieve the result:

‎packages/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyper3d/cli",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Hyper3D CLI backed by MCP",
55
"repository": {
66
"type": "git",

‎packages/cli/src/auth.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async function discoverDeviceFlow(
203203
!metadata.grant_types_supported?.includes(DEVICE_GRANT_TYPE)
204204
)
205205
throw new Error(
206-
'The server does not advertise Device Flow. Deploy and enable the backend before logging in.',
206+
'The server does not advertise Device Flow. Contact the service administrator for login support.',
207207
);
208208
if (!metadata.token_endpoint) throw new Error('Missing OAuth token endpoint');
209209
secureUrl(metadata.token_endpoint);

‎packages/cli/src/base_schema.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
{
203203
"name": "rodin_generate",
204204
"title": "Generate a Rodin 3D model",
205-
"description": "Start a Rodin Gen-2.5 generation from a non-empty prompt, one or more reference images, or both. At least one of prompt or reference_upload_ids is required. For image references in ChatGPT Chat, first call rodin_import_images and pass the returned uploads[].upload_id values as reference_upload_ids in order. The presigned upload workflow uses rodin_create_uploads followed by successful HTTP PUT uploads. This consumes credits. The response includes display_url; present that URL only after the generation completes. If this call times out, do not retry it automatically; ask the user to check Hyper3D Mine.",
205+
"description": "Start a Rodin Gen-2.5 generation from a non-empty prompt, one or more reference images, or both. At least one of prompt or reference_upload_ids is required. For image references in ChatGPT Chat, first call rodin_import_images and pass the returned uploads[].upload_id values as reference_upload_ids in order. The presigned upload workflow uses rodin_create_uploads followed by successful HTTP PUT uploads. texture_delight defaults to false; setting it to true is recommended when reference images contain highly reflective surfaces. This consumes credits. The response includes display_url; present that URL only after the generation completes. If this call times out, do not retry it automatically; ask the user to check Hyper3D Mine.",
206206
"inputSchema": {
207207
"type": "object",
208208
"properties": {
@@ -232,6 +232,11 @@
232232
"enum": ["Gen-2.5-Medium", "Gen-2.5-High", "Gen-2.5-Extreme-Low"],
233233
"default": "Gen-2.5-Medium"
234234
},
235+
"texture_delight": {
236+
"type": "boolean",
237+
"default": false,
238+
"description": "Enable texture de-lighting. Defaults to false; recommended when reference images contain highly reflective surfaces."
239+
},
235240
"quality_override": {
236241
"type": "integer",
237242
"minimum": 500,

‎packages/cli/src/index.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ cli
103103
'Generation tier: Gen-2.5-Medium, Gen-2.5-High, Gen-2.5-Extreme-Low (server default: Gen-2.5-Medium)',
104104
)
105105
.option('--mesh-mode <mode>', 'Mesh mode: Raw, Quad (server default: Raw)')
106+
.option(
107+
'--texture-delight',
108+
'Enable texture de-lighting; recommended for highly reflective reference images (server default: false)',
109+
)
106110
.option(
107111
'--format <format>',
108112
'Geometry format: glb, usdz, fbx, obj, stl (server default: glb)',

0 commit comments

Comments
 (0)