Repository navigation
feat(website): add Openjutsu, a character-swap Hub app, behind a staff-only flag #20965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
9450ee7
feat(website): Openjutsu app, interface on a sample backend
comfyrob bc7230b
feat(website): reusable video trim dialog, used by Openjutsu
comfyrob 6c0e22a
feat(website): Openjutsu graph runs on core nodes only
comfyrob d3f7378
feat(website): Openjutsu follows the LoRA author's length rule
comfyrob 0358235
refactor(website): keep Openjutsu's frame rate constant private
comfyrob 9aae81b
fix(website): Openjutsu trims the source without requiring an exact l…
comfyrob cdef38f
docs(website): Openjutsu GPU cost benchmark on RTX PRO 6000
comfyrob 78bd651
feat(website): Openjutsu 480p option, and results keep the source shape
comfyrob f7cdb78
docs(website): Openjutsu benchmark on clean HD sources
comfyrob a536fe3
feat(website): Openjutsu runs against its deployment through a local …
comfyrob b879b9f
refactor(website): split the Openjutsu stage and trim logic into smal…
comfyrob 31c4f40
feat(website): shared full-screen editor pieces for the Workshop apps…
mariana953 e419406
test(website): cover the shared editor zoom, and keep the kit stories…
mariana953 5d81c2d
feat(website): Openjutsu full screen on the shared editor, with the s…
mariana953 c6b4708
fix(website): editor kit review fixes: drop zone highlight, number fi…
mariana953 cabebe5
refactor(website): split the editor zoom pointer-down and the demo up…
mariana953 92a7c5f
fix(website): keep the latest editor upload, refuse empty numbers, co…
mariana953 eeb1d1a
fix(website): refuse negative fractions in the editor number field
mariana953 364e6fe
fix(website): align the Openjutsu panel with the editor kit
mariana953 bf86070
feat(website): app GitHub link always shows, opening Comfy's GitHub u…
mariana953 7fc27bb
feat(website): Openjutsu panel takes its inputs like Cinematic Studio…
mariana953 79aa0d8
fix(website): Openjutsu seed and trim line fit the panel on one line
mariana953 8ecacd7
feat(website): editor kit source tile, the starting image or video al…
mariana953 1c4ab9c
feat(website): Openjutsu shows the starting video alone at the top of…
mariana953 3be3437
fix(website): keep the Openjutsu display entry in sorted order
comfyrob 56bf98d
fix(website): list Openjutsu where the display generator sorts it
mariana953 74cd529
fix(website): save an Openjutsu result uncut when nothing was generat…
comfyrob 2539126
fix(website): Openjutsu takes the character image through its own upl…
comfyrob a0569cc
feat(website): Openjutsu cuts long videos on its own and keeps the pa…
mariana953 7394502
fix(website): Openjutsu gives the seed its own row so it is not cut off
mariana953 b6cb043
fix(website): full-screen apps drop the site footer and open the pane…
mariana953 dc06a9e
fix(website): the open settings sheet on phones reaches up to the header
mariana953 87b6752
feat(website): Openjutsu starts from four examples instead of an uplo…
mariana953 dac1331
fix(website): Openjutsu puts the trim note in its own quiet box
mariana953 d99b663
fix(website): Openjutsu puts its examples inside a card
mariana953 3aae90c
fix(website): Openjutsu makes the trim note easier to see
mariana953 dae5e99
fix(website): keep every Openjutsu example clip under 1 MiB
mariana953 0c413d4
feat(website): Openjutsu shows its examples two by two inside the fra…
mariana953 bb3ad6b
feat(website): show Openjutsu examples as a card with a two-column grid
mariana953 32750a9
fix(website): Openjutsu keeps only the example title and capitalises …
mariana953 b959292
Merge remote-tracking branch 'origin/mariana/openjutsu-fullscreen' in…
comfyrob 53e9061
Merge remote-tracking branch 'origin/main' into rob/app-openjutsu
comfyrob a6b8d3a
feat(website): Openjutsu reads its app proxy ids and shows the per-fr…
comfyrob b830faf
docs(website): Openjutsu's deployment moved to the Workshop Apps work…
comfyrob 177f8e2
docs(website): Openjutsu handoff notes
comfyrob fe8c79f
docs(website): Openjutsu handoff notes after merging the redesign and…
comfyrob 1a12258
fix(website): Openjutsu opens the trim on every video a visitor adds
comfyrob 1192e41
test(website): run an Openjutsu swap through a faked app proxy in the…
comfyrob 39d3743
Merge remote-tracking branch 'origin/main' into rob/app-openjutsu
comfyrob 2519c9f
test(website): cover the video trim dialog's reading, limits and confirm
comfyrob 63fdde2
fix(website): address review on Openjutsu
comfyrob 48be80b
Merge remote-tracking branch 'origin/main' into rob/app-openjutsu
comfyrob 88b27f5
chore(website): drop code comments from the Openjutsu review fixes
comfyrob 586ee09
fix(website): Openjutsu holds Generate when it cannot show the price
comfyrob cf53aaf
fix(website): Openjutsu prices runs the way the app proxy now bills them
comfyrob 8ee4e9c
fix(website): serve the Openjutsu examples from media.comfy.org
comfyrob 3e73121
feat(website): give the Openjutsu card its looping thumbnail
comfyrob 5d492f3
feat(website): new Openjutsu examples
comfyrob 719a6cc
feat(website): Openjutsu runs without saying who to replace
comfyrob 4ec1521
feat(website): Openjutsu runs Akatz Labs' H3 Character Swap workflow
comfyrob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import { readFileSync } from 'node:fs' | ||
| import { join } from 'node:path' | ||
|
|
||
| import type { Page, Request, Route } from '@playwright/test' | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import { websiteRoot } from '@website/paths' | ||
|
|
||
| type Answer = Parameters<Route['fulfill']>[0] | ||
|
|
||
| const QUOTE = { | ||
| free_runs_remaining: 0, | ||
| resets_at: null, | ||
| price_credits: 0, | ||
| price_per_second: { | ||
| tier_input: 'resolution', | ||
| tier_match: 'exact', | ||
| credits: { '480': 8, '768': 16 } | ||
| }, | ||
| next_run: 'paid' | ||
| } | ||
|
|
||
| const SWAP_JOB = { | ||
| id: 'e2e-openjutsu-swap', | ||
| status: 'succeeded', | ||
| outputs: [{ id: 'out', filename: 'openjutsu/result_00001_.mp4' }] | ||
| } | ||
|
|
||
| export async function mockOpenjutsuProxy(page: Page, workspaceToken: string) { | ||
| const calls: string[] = [] | ||
| const result = readFileSync( | ||
| join(websiteRoot, 'e2e/assets/validation-16s.mp4') | ||
| ) | ||
| let uploads = 0 | ||
| const answers = new Map<string, (request: Request) => Answer>( | ||
| Object.entries({ | ||
| 'GET /quote': () => ({ json: QUOTE }), | ||
| 'POST /assets': () => ({ | ||
| json: { file_path: `openjutsu-e2e-${++uploads}` } | ||
| }), | ||
| 'POST /jobs': (request: Request) => { | ||
| const sent = request.postData() ?? '' | ||
| expect(sent).toContain('H3CharacterSwapPrepareVideo') | ||
| expect(sent).toContain('"resolution":768') | ||
| expect(sent).toContain('"use_anchor":false') | ||
| return { json: SWAP_JOB } | ||
| }, | ||
| [`GET /jobs/${SWAP_JOB.id}`]: () => ({ json: SWAP_JOB }), | ||
| [`GET /jobs/${SWAP_JOB.id}/outputs/out/content`]: () => ({ | ||
| contentType: 'video/mp4', | ||
| body: result | ||
| }) | ||
| }) | ||
| ) | ||
| await page.route(/\/v2\/models\/openai\/gpt-image-2\.5-sunburst/, (route) => | ||
| route.fulfill({ status: 503, json: { error_type: 'unavailable' } }) | ||
| ) | ||
| await page.route(/\/app-proxy\/[^/]+\//, async (route: Route) => { | ||
| const request = route.request() | ||
| const path = new URL(request.url()).pathname.replace( | ||
| /^.*\/app-proxy\/[^/]+/, | ||
| '' | ||
| ) | ||
| const call = `${request.method()} ${path}` | ||
| calls.push(call) | ||
| expect(request.headers()['authorization']).toBe(`Bearer ${workspaceToken}`) | ||
| const answer = answers.get(call) | ||
| return route.fulfill( | ||
| answer | ||
| ? answer(request) | ||
| : { status: 404, json: { error_type: 'not_found' } } | ||
| ) | ||
| }) | ||
| return calls | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| import { join } from 'node:path' | ||
|
|
||
| import type { BrowserContext } from '@playwright/test' | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import { websiteRoot } from '@website/paths' | ||
| import { test } from './fixtures/blockExternalMedia' | ||
| import { | ||
| MODELS_WORKSPACE_TOKEN, | ||
| test as signedInTest | ||
| } from './fixtures/modelsAccount' | ||
| import { mockOpenjutsuProxy } from './fixtures/openjutsuProxy' | ||
|
|
||
| const asset = (name: string) => join(websiteRoot, 'e2e/assets', name) | ||
|
|
||
| async function mockFlags(context: BrowserContext, openjutsu: boolean) { | ||
| await context.route('**/t.comfy.org/**', (route) => | ||
| /\/(flags|decide)\//.test(route.request().url()) | ||
| ? route.fulfill({ | ||
| contentType: 'application/json', | ||
| json: { | ||
| featureFlags: { | ||
| 'workshop-enabled': true, | ||
| 'workshop-apps-enabled': true, | ||
| 'workshop-auth': true, | ||
| 'workshop-openjutsu-app-enabled': openjutsu | ||
| }, | ||
| featureFlagPayloads: {} | ||
| } | ||
| }) | ||
| : route.abort('blockedbyclient') | ||
| ) | ||
| } | ||
|
|
||
| test('keeps Openjutsu closed while its flag is off', async ({ | ||
| page, | ||
| context | ||
| }) => { | ||
| await mockFlags(context, false) | ||
| await page.goto('/hub/apps/openjutsu/') | ||
| await expect(page.getByText('Openjutsu is not open yet')).toBeVisible() | ||
| await expect(page.getByTestId('openjutsu')).toHaveCount(0) | ||
| }) | ||
|
|
||
| signedInTest( | ||
| 'swaps a character through the app proxy, at the price the page showed', | ||
| async ({ page, context, modelsAccount }) => { | ||
| await mockFlags(context, true) | ||
| await context.route('https://apis.google.com/js/api.js*', (route) => | ||
| route.abort('blockedbyclient') | ||
| ) | ||
| const proxy = await mockOpenjutsuProxy(page, MODELS_WORKSPACE_TOKEN) | ||
| await page.goto('/login/') | ||
| 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('/') | ||
|
|
||
| await page.goto('/hub/apps/openjutsu/') | ||
| await page | ||
| .getByTestId('openjutsu-video-file') | ||
| .setInputFiles(asset('validation-16s.mp4')) | ||
| await expect( | ||
| page.getByTestId('video-trim-dialog'), | ||
| "a visitor's own video opens the trim first" | ||
| ).toBeVisible() | ||
| await page.getByTestId('video-trim-confirm').click() | ||
| await page | ||
| .getByTestId('openjutsu-character-file') | ||
| .setInputFiles(asset('placeholder-1x1.webp')) | ||
| await page.getByLabel('Extra direction').fill('keep the glasses') | ||
|
|
||
| await expect(page.getByTestId('openjutsu-price')).toHaveText('240 credits') | ||
| await page.getByTestId('openjutsu-action').click() | ||
|
|
||
| await expect | ||
| .poll(() => proxy) | ||
| .toContain('GET /jobs/e2e-openjutsu-swap/outputs/out/content') | ||
| expect(proxy.filter((call) => call === 'POST /assets')).toHaveLength(2) | ||
| expect(proxy.filter((call) => call === 'POST /jobs')).toHaveLength(1) | ||
| } | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <script setup lang="ts"> | ||
| import { useMounted } from '@vueuse/core' | ||
| import { computed, defineAsyncComponent } from 'vue' | ||
|
|
||
| import { resolveWorkshopAccountSource } from '@/config/workshop-account-source' | ||
| import type { Locale } from '@/i18n/translations' | ||
| import { useWorkshopAuthFlag, useWorkshopEnabled } from '@/scripts/posthog' | ||
|
|
||
| const { locale = 'en' } = defineProps<{ locale?: Locale }>() | ||
|
|
||
| const mounted = useMounted() | ||
| const workshopEnabled = useWorkshopEnabled() | ||
| const workshopAuthEnabled = useWorkshopAuthFlag() | ||
| const shown = computed( | ||
| () => mounted.value && workshopEnabled.value && workshopAuthEnabled.value | ||
| ) | ||
|
|
||
| // Each loader waits for the account source, so a visitor the web session | ||
| // knows never mounts an island that would start Firebase. | ||
| const HeaderAccount = defineAsyncComponent(async () => { | ||
| const [source, firebaseHeader] = await Promise.all([ | ||
| resolveWorkshopAccountSource(), | ||
| import('@/components/workshop/HeaderAccount.vue') | ||
| ]) | ||
| return source === 'session' | ||
| ? import('@/components/workshop/HeaderSessionAccount.vue') | ||
| : firebaseHeader | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <HeaderAccount v-if="shown" :locale /> | ||
| </template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.