Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .fallowrc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
// Loaded by config, not imported: oxlint jsPlugin (.oxlintrc.json) and
// stylelint customSyntax (.stylelintrc.json) respectively.
"eslint-plugin-playwright",
"postcss-html"
"postcss-html",
// Executed by models-snippets.test.ts inside the generated Node examples.
"mime-types"
],

"ignoreUnresolvedImports": [
Expand Down
7 changes: 7 additions & 0 deletions apps/website/MODELS_CONTENT_FORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ preserved in the packed file, not added to the UI.
Old model-only URLs redirect to a deterministic current record. Detail lookup,
sample ownership and saved drafts use the content slug, not only the Router ID.

Corrections to a published page's catalogue category live in
`src/data/workshop-use-case-overrides.json`, keyed by verified Router ID. They
change its search/category/task labels while preserving the published URL,
example ownership and production-test ledger. The OpenAI GPT Image routes
accept text-to-image generation, so their imported `edit-images` categorization
is corrected to `generate-images`. The build rejects unknown IDs or categories.

## Media policy

A thumbnail or output sample URL may not be published in two different use
Expand Down
43 changes: 37 additions & 6 deletions apps/website/MODELS_INPUT_SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ HeyGen's curated language choices correspond to languages in the
Language and locale remain unset for automatic detection; a selected locale
overrides language, as described in the
[HeyGen speech contract](https://developers.heygen.com/docs/voices/speech).
Voice ID stays editable in Advanced with the existing tested voice.
Voice ID is hidden and fixed to the existing tested account voice in the
input-presentation data; creators cannot choose an unavailable account voice.

Model price estimates prefer the generated node pricing rules. Models whose
nodes have no price badge can use verified flat rates from
Expand Down Expand Up @@ -332,11 +333,24 @@ with `pnpm --filter @comfyorg/website generate:workshop-router-contracts`.
- Multiple Qwen reference inputs become ordered native image entries; Base64
arrays and first/last-frame mappings remain unchanged. This does not add every
optional provider media mode or override provider-specific limits.
- Python/TypeScript examples use the same storage handshake for URL files and
local Base64 encoding for Base64 files. cURL continues to omit local files and
marks the request incomplete. For script retries, reuse the prepared URLs and
key; rerunning upload setup creates different request URLs. Signed URLs and
keys must not be logged, checked in, or put into the content pack.
- Python/TypeScript examples use `comfy-sdk==0.2.0` / `@comfyorg/sdk@0.2.0`.
URL-capable local inputs use SDK assets; native inline-only inputs retain
Base64 with MIME inferred from the supplied file or HTTP response. Default
source URLs remain runnable without inventing local filenames. Preparing the
API tab does not read private file bytes or download example media.
Embedded default media retains its original data URI: inline requests use
those known bytes, and URL inputs use the SDK's `assets.from_bytes` /
`assets.fromBytes`. User-selected files still refer to local paths.
- JSON endpoints use the SDK's `models.run`, which owns request identity and
retries. SDK 0.2.0 cannot decode binary responses, so binary/unknown-output
endpoints retain HTTP examples that check errors and save non-JSON bytes.
cURL generates a fresh key on execution, preserves usable source URLs, and
warns when it omits file inputs. Retrying a request requires its original
prepared body and key. Credentials are checked before accessing inputs.
- SDK examples use the same environment family as the page, with separate
`COMFY_ROUTER_BASE_URL` and `COMFY_BASE_URL` overrides. SDK dependencies are
development-only: tests execute generated code; they add no browser imports.
Signed URLs and keys must not be checked in or put into the content pack.

**Live verification is blocked, not certified.** On September 10, both
`api-nodes-prod` and `api-nodes-staging` returned HTTP 200 without any
Expand Down Expand Up @@ -442,6 +456,23 @@ Content identity and unfinished per-use-case widget customization are documented
in [Models content format](MODELS_CONTENT_FORMAT.md). Live render tests remain
paused while these input definitions are tuned.

## Sign-in drafts

Signed-out visitors can select local media before signing in. The same
pre-navigation hook serves the header and Playground: scalar edits flush to
session storage, while media is saved to IndexedDB before same-tab navigation.
No file is uploaded until the authenticated Run path prepares the request.

Each tab stores an opaque draft key in session storage. Media drafts are consumed
on return, validated against the current input schema, and usable for one hour.
Writes prune expired entries and retain at most four drafts, each capped at
100 MiB. Entries left behind by an abandoned login are pruned on a later write;
there is no background deletion timer. Document-owned Blob URLs are never stored.
The storage operation has a five-second deadline and aborts with its component.
Repeated sign-in clicks share one save; completion cannot redirect a departed
page. If storage fails, sign-in proceeds and the return page asks the visitor to
reselect missing files instead of silently submitting default media.

## Verification boundaries

During input tuning, use a short change → focused test/browser check → fix loop.
Expand Down
24 changes: 24 additions & 0 deletions apps/website/e2e/models-catalogue-corrections.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from '@playwright/test'

import { test } from './fixtures/modelsAccount'

test('GPT Image generation pages are discoverable as text-to-image while published URLs remain valid', async ({
page
}) => {
await page.goto('/models/?useCase=generate-images')
await page.getByTestId('workshop-search').fill('gpt image')
const cards = page
.getByTestId('workshop-models-grid')
.getByTestId('workshop-model-card')
await expect(cards).toHaveCount(3)
await page.getByRole('link', { name: /GPT Image 1\.5/ }).click()
await expect(page).toHaveURL(
/\/models\/openai--gpt-image-1\.5--edit-images\/$/
)
await expect(
page.getByRole('textbox', { name: 'Prompt', exact: true })
).toBeVisible()
await page.goto('/models/?useCase=edit-images')
await page.getByTestId('workshop-search').fill('gpt image')
await expect(cards).toHaveCount(0)
})
141 changes: 141 additions & 0 deletions apps/website/e2e/models-sign-in-draft.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import { readFileSync } from 'node:fs'
import { expect } from '@playwright/test'

import { test } from './fixtures/modelsAccount'

const path = '/models/byteplus--seedream-4-5--edit-images/'

for (const entry of ['playground', 'header']) {
test(`selected reference bytes survive ${entry} sign-in and reach Router`, async ({
page,
modelsAccount
}) => {
await page.goto(path)
const chooser = page.waitForEvent('filechooser')
await page
.getByText('Choose images or drop them here', { exact: true })
.click()
await (await chooser).setFiles('e2e/assets/placeholder-1x1.webp')
const replacement = page.getByRole('button', {
name: 'Replace placeholder-1x1.webp'
})
await expect(replacement).toBeVisible()
await page
.getByRole('textbox', { name: 'Prompt', exact: true })
.fill('Keep the reference character, watercolor style')
const signIn =
entry === 'playground'
? page.getByRole('link', { name: 'Sign in to run', exact: true })
: page.getByRole('link', { name: 'Sign in', exact: true })
await signIn.click()
await expect(page).toHaveURL(/\/login\/\?returnTo=/)
await page.getByRole('button', { name: 'Use email instead' }).click()
await page.getByLabel('Email').fill(modelsAccount.email)
await page
.getByLabel('Password', { exact: true })
.fill(modelsAccount.password)
await page.getByRole('button', { name: 'Sign in', exact: true }).click()
await expect(page).toHaveURL(new RegExp(`${path}$`))
await expect(replacement).toBeVisible()
await expect(
page.getByRole('textbox', { name: 'Prompt', exact: true })
).toHaveValue('Keep the reference character, watercolor style')
const request = page.waitForRequest(
'**/v2/models/byteplus/seedream-4-5-251128'
)
let calls = 0
await page.route('**/v2/models/**', (route) => {
if (++calls === 2)
return route.fulfill({
status: 503,
headers: { 'X-Comfy-Error-Type': 'provider_error' },
contentType: 'application/json',
body: JSON.stringify({ detail: 'Temporary provider error' })
})
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
images: [{ url: 'https://media.comfy.org/tests/result.webp' }]
})
})
})
await page.getByRole('button', { name: 'Run', exact: true }).click()
const first = await request
expect(first.postDataJSON()).toMatchObject({
prompt: 'Keep the reference character, watercolor style',
image:
'data:image/webp;base64,' +
readFileSync('e2e/assets/placeholder-1x1.webp').toString('base64')
})
await expect(page.getByTestId('playground-output')).toHaveAttribute(
'data-state',
'succeeded'
)
const changedBytes = readFileSync('public/hero/input.webp')
const replaceChooser = page.waitForEvent('filechooser')
await replacement.click()
await (
await replaceChooser
).setFiles({
name: 'placeholder-1x1.webp',
mimeType: 'image/webp',
buffer: changedBytes
})
const changedRequest = page.waitForRequest(
'**/v2/models/byteplus/seedream-4-5-251128'
)
await page.getByRole('button', { name: 'Run', exact: true }).click()
const changed = await changedRequest
expect(changed.postDataJSON()).toMatchObject({
image: 'data:image/webp;base64,' + changedBytes.toString('base64')
})
expect(changed.headers()['idempotency-key']).not.toBe(
first.headers()['idempotency-key']
)
await expect(page.getByTestId('playground-output')).toHaveAttribute(
'data-state',
'failed'
)
const retryRequest = page.waitForRequest(
'**/v2/models/byteplus/seedream-4-5-251128'
)
await page.getByRole('button', { name: 'Run', exact: true }).click()
const retried = await retryRequest
expect(retried.postDataJSON()).toEqual(changed.postDataJSON())
expect(retried.headers()['idempotency-key']).toBe(
changed.headers()['idempotency-key']
)
await expect(page.getByTestId('playground-output')).toHaveAttribute(
'data-state',
'succeeded'
)
})
}

test('unavailable draft storage does not trap sign-in and reports missing files on return', async ({
page
}) => {
await page.addInitScript(() => {
window.indexedDB.open = () => {
throw new DOMException('Storage disabled', 'SecurityError')
}
})
await page.goto(path)
const chooser = page.waitForEvent('filechooser')
await page
.getByText('Choose images or drop them here', { exact: true })
.click()
await (await chooser).setFiles('e2e/assets/placeholder-1x1.webp')
await page.getByRole('link', { name: 'Sign in to run', exact: true }).click()
await expect(page).toHaveURL(/\/login\/\?returnTo=/)
await page.goto(path)
await expect(
page.getByText(
'Some saved inputs could not be restored. Check your inputs and select your files again.'
)
).toBeVisible()
await expect(
page.getByRole('button', { name: 'Replace placeholder-1x1.webp' })
).toHaveCount(0)
})
7 changes: 5 additions & 2 deletions apps/website/e2e/workshop-input-feedback.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test('Beeble displays readable options while the API keeps its native values', a
await expect(page.getByTestId('snippet')).toContainText('fill')
})

test('HeyGen offers named language and locale choices and keeps Voice ID in Advanced', async ({
test('HeyGen offers named language and locale choices and uses the supported voice without exposing its account-specific ID', async ({
page
}) => {
await page.goto('/models/heygen--starfish-tts--audio/')
Expand All @@ -83,9 +83,12 @@ test('HeyGen offers named language and locale choices and keeps Voice ID in Adva
await page.getByTestId('playground-advanced').locator('summary').click()
await expect(
page.getByRole('textbox', { name: 'Voice ID', exact: true })
).toBeVisible()
).toHaveCount(0)
await page.getByRole('tab', { name: 'API', exact: true }).click()
await expect(page.getByTestId('snippet')).toContainText('fr-FR')
await expect(page.getByTestId('snippet')).toContainText(
'd2f4f24783d04e22ab49ee8fdc3715e0'
)
await expect(page.getByTestId('snippet')).not.toContainText('French (France)')
})

Expand Down
2 changes: 2 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@astrojs/check": "catalog:",
"@astrojs/mdx": "catalog:",
"@astrojs/vue": "catalog:",
"@comfyorg/sdk": "catalog:",
"@playwright/test": "catalog:",
"@storybook/vue3-vite": "catalog:",
"@tailwindcss/vite": "catalog:",
Expand All @@ -79,6 +80,7 @@
"@vitejs/plugin-vue": "catalog:",
"astro": "catalog:",
"happy-dom": "catalog:",
"mime-types": "catalog:",
"tailwindcss": "catalog:",
"tsx": "catalog:",
"tw-animate-css": "catalog:",
Expand Down
7 changes: 5 additions & 2 deletions apps/website/scripts/workshop-input-presentation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,11 @@ describe('curated model inputs', () => {
},
{
id: 'heygen/starfish',
values: { text: 'Hello', voice_id: 'creator-voice' },
expected: { input_type: 'text', voice_id: 'creator-voice' },
values: { text: 'Hello' },
expected: {
input_type: 'text',
voice_id: 'd2f4f24783d04e22ab49ee8fdc3715e0'
},
absent: ['language', 'locale']
},
{
Expand Down
Loading
Loading