mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-06 11:47:03 +08:00
add better error propagation to veo2 (#37)
This commit is contained in:
parent
dea5c14283
commit
6a4da9cb1e
@ -1,6 +1,6 @@
|
|||||||
# generated by datamodel-codegen:
|
# generated by datamodel-codegen:
|
||||||
# filename: https://stagingapi.comfy.org/openapi
|
# filename: filtered-openapi.yaml
|
||||||
# timestamp: 2025-04-29T03:13:19+00:00
|
# timestamp: 2025-04-29T23:44:54+00:00
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
# generated by datamodel-codegen:
|
# generated by datamodel-codegen:
|
||||||
# filename: https://stagingapi.comfy.org/openapi
|
# filename: filtered-openapi.yaml
|
||||||
# timestamp: 2025-04-29T03:13:19+00:00
|
# timestamp: 2025-04-29T23:44:54+00:00
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pydantic import BaseModel, Field, constr
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
class V2OpenAPII2VResp(BaseModel):
|
class V2OpenAPII2VResp(BaseModel):
|
||||||
@ -30,10 +30,10 @@ class V2OpenAPIT2VReq(BaseModel):
|
|||||||
description='Motion mode (normal, fast, --fast only available when duration=5; --quality=1080p does not support fast)',
|
description='Motion mode (normal, fast, --fast only available when duration=5; --quality=1080p does not support fast)',
|
||||||
examples=['normal'],
|
examples=['normal'],
|
||||||
)
|
)
|
||||||
negative_prompt: Optional[constr(max_length=2048)] = Field(
|
negative_prompt: Optional[str] = Field(
|
||||||
None, description='Negative prompt\n'
|
None, description='Negative prompt\n', max_length=2048
|
||||||
)
|
)
|
||||||
prompt: constr(max_length=2048) = Field(..., description='Prompt')
|
prompt: str = Field(..., description='Prompt', max_length=2048)
|
||||||
quality: str = Field(
|
quality: str = Field(
|
||||||
...,
|
...,
|
||||||
description='Video quality ("360p"(Turbo model), "540p", "720p", "1080p")',
|
description='Video quality ("360p"(Turbo model), "540p", "720p", "1080p")',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -228,8 +228,28 @@ class VeoVideoGenerationNode(ComfyNodeABC):
|
|||||||
|
|
||||||
poll_response = poll_operation.execute()
|
poll_response = poll_operation.execute()
|
||||||
|
|
||||||
|
# Check for error in poll response
|
||||||
|
if hasattr(poll_response, 'error') and poll_response.error:
|
||||||
|
error_message = f"Veo API error: {poll_response.error.message} (code: {poll_response.error.code})"
|
||||||
|
logging.error(error_message)
|
||||||
|
raise Exception(error_message)
|
||||||
|
|
||||||
if poll_response.done:
|
if poll_response.done:
|
||||||
if poll_response.response and poll_response.response.videos and len(poll_response.response.videos) > 0:
|
# Check for RAI filtered content
|
||||||
|
if (hasattr(poll_response.response, 'raiMediaFilteredCount') and
|
||||||
|
poll_response.response.raiMediaFilteredCount > 0):
|
||||||
|
|
||||||
|
# Extract reason message if available
|
||||||
|
if (hasattr(poll_response.response, 'raiMediaFilteredReasons') and
|
||||||
|
poll_response.response.raiMediaFilteredReasons):
|
||||||
|
reason = poll_response.response.raiMediaFilteredReasons[0]
|
||||||
|
error_message = f"Content filtered by Google's Responsible AI practices: {reason} ({poll_response.response.raiMediaFilteredCount} videos filtered.)"
|
||||||
|
|
||||||
|
logging.error(error_message)
|
||||||
|
raise Exception(error_message)
|
||||||
|
|
||||||
|
# Process successful response
|
||||||
|
if poll_response.response and hasattr(poll_response.response, 'videos') and poll_response.response.videos and len(poll_response.response.videos) > 0:
|
||||||
video = poll_response.response.videos[0]
|
video = poll_response.response.videos[0]
|
||||||
|
|
||||||
# Check if video is provided as base64 or URL
|
# Check if video is provided as base64 or URL
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user