File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,23 +129,17 @@ def validate_prompt_or_reference_image(self) -> "VideoRestyleInput":
129129class VideoEdit2Input (DecartBaseModel ):
130130 """Input for lucy-2-v2v model.
131131
132- Must provide at least one of `prompt` or `reference_image` .
133- Both can be provided together .
132+ Prompt is required but can be an empty string .
133+ Optional reference_image can also be provided.
134134 """
135135
136- prompt : Optional [ str ] = Field (default = None , min_length = 1 , max_length = 1000 )
136+ prompt : str = Field (... , max_length = 1000 )
137137 reference_image : Optional [FileInput ] = None
138138 data : FileInput
139139 seed : Optional [int ] = None
140140 resolution : Optional [str ] = None
141141 enhance_prompt : Optional [bool ] = None
142142
143- @model_validator (mode = "after" )
144- def validate_prompt_or_reference_image (self ) -> "VideoEdit2Input" :
145- if self .prompt is None and self .reference_image is None :
146- raise ValueError ("Must provide at least one of 'prompt' or 'reference_image'" )
147- return self
148-
149143
150144class TextToImageInput (BaseModel ):
151145 prompt : str = Field (
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ async def test_queue_lucy2_v2v_with_prompt() -> None:
289289
290290
291291@pytest .mark .asyncio
292- async def test_queue_lucy2_v2v_with_reference_image_only () -> None :
292+ async def test_queue_lucy2_v2v_with_empty_prompt_and_reference_image () -> None :
293293 client = DecartClient (api_key = "test-key" )
294294
295295 with patch ("decart.queue.client.submit_job" ) as mock_submit :
@@ -298,6 +298,7 @@ async def test_queue_lucy2_v2v_with_reference_image_only() -> None:
298298 job = await client .queue .submit (
299299 {
300300 "model" : models .video ("lucy-2-v2v" ),
301+ "prompt" : "" ,
301302 "reference_image" : b"fake image data" ,
302303 "data" : b"fake video data" ,
303304 }
@@ -330,21 +331,6 @@ async def test_queue_lucy2_v2v_with_both_prompt_and_reference_image() -> None:
330331 mock_submit .assert_called_once ()
331332
332333
333- @pytest .mark .asyncio
334- async def test_queue_lucy2_v2v_rejects_neither_prompt_nor_reference_image () -> None :
335- client = DecartClient (api_key = "test-key" )
336-
337- with pytest .raises (DecartSDKError ) as exc_info :
338- await client .queue .submit (
339- {
340- "model" : models .video ("lucy-2-v2v" ),
341- "data" : b"fake video data" ,
342- }
343- )
344-
345- assert "at least one of 'prompt' or 'reference_image'" in str (exc_info .value ).lower ()
346-
347-
348334# Tests for lucy-restyle-v2v with reference_image
349335
350336
You can’t perform that action at this time.
0 commit comments