You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] image i2i fails with AuthExpiredError: HTTP 401 (missing UI-automation for uploads) #39
[BUG/FEATURE] Robust i2v and i2i support via "API-via-Browser" Bypass
Description:
Character consistency in v0.7.0 is currently blocked because i2v and i2i require an image upload. The current transport logic falls back to a legacy HTTP POST which fails with 401 Unauthorized.
Empirical research using browser-harness has identified a highly robust "API-via-Browser" bypass that eliminates the need for complex UI clicking and solves the auth issue.
Technical Discovery:
Hidden Gateway: Google Flow maintains a persistent hidden file input: input[type="file"][accept="image/*"].
Direct Upload: Verified that calling page.set_input_files(selector, path) on this input automatically triggers the uploadImage XHR request without any button clicking.
UUID Extraction: The image UUID (needed for generation) is returned in the JSON response at media.name.
Auth Solution: By using page.evaluate(fetch, ...) inside the browser session, we can reuse the application's internal Authorization (Bearer) tokens and session state.
Proposed Implementation (Task 0 Fix):
Implement upload_image in ui_automation.py:
Use page.set_input_files('input[type="file"][accept="image/*"]', path).
Register a page.on("response") listener to capture the result from https://aisandbox-pa.googleapis.com/v1/flow/uploadImage.
Return the extracted media[0].name.
Implement i2v (Image-to-Video) in ui_automation_video.py:
Instead of navigating dropdowns, capture the Authorization header from the upload request.
Use page.evaluate() to call the batchAsyncGenerateVideoStartAndEndImage endpoint using fetch().
This ensures all cookies and tokens are valid, bypassing the 401 error.
Impact:
Restores character consistency for automated pipelines (Stickman/Kitten archetypes).
significantly faster than UI-automation based clicking.
Robust against UI layout changes.
Verification:
Verified manually using a standalone script that successfully triggered the upload and captured the UUID.
Requires integration into the UiAutomationTransport protocol.
Activity
feat(image): bind i2i local refs via editor media dialog
Merge pull request #50 from svasakorn/feat/image-i2i-ref-attach
fix(image): re-introduce i2i ref-attach (#50) with locale-agnostic me…
feat(image): bind i2i local refs via editor media dialog
Merge pull request ffroliva#50 from svasakorn/feat/image-i2i-ref-attach
fix(image): re-introduce i2i ref-attach (ffroliva#50) with locale-agn…