vibe-aigc 0.7.0__py3-none-any.whl → 0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -232,8 +232,9 @@ class VideoGenerationTool(BaseTool):
232
232
  """
233
233
  Video generation tool using local ComfyUI.
234
234
 
235
- Uses the I2V pipeline: FLUX → Wan I2V animation.
236
- MetaPlanner can use this for motion content.
235
+ Supports two modes:
236
+ - With image_url: Uses I2V (Image-to-Video) to animate existing image
237
+ - Without image_url: Uses T2V (Text-to-Video) to generate from scratch
237
238
  """
238
239
 
239
240
  def __init__(self, comfyui_url: str = "http://127.0.0.1:8188"):
@@ -244,13 +245,14 @@ class VideoGenerationTool(BaseTool):
244
245
  def spec(self) -> ToolSpec:
245
246
  return ToolSpec(
246
247
  name="video_generation",
247
- description="Generate videos using local AI models (FLUX + Wan I2V)",
248
+ description="Generate videos using local AI models. Pass image_url to animate an existing image (I2V), or just prompt for text-to-video.",
248
249
  category=ToolCategory.VIDEO,
249
250
  input_schema={
250
251
  "type": "object",
251
252
  "required": ["prompt"],
252
253
  "properties": {
253
- "prompt": {"type": "string", "description": "Video description"},
254
+ "prompt": {"type": "string", "description": "Video/motion description"},
255
+ "image_url": {"type": "string", "description": "Source image URL to animate (enables I2V mode)"},
254
256
  "negative_prompt": {"type": "string", "description": "What to avoid"},
255
257
  "style": {"type": "string", "description": "Visual style hints"},
256
258
  "motion": {"type": "string", "description": "Motion description"},
@@ -269,7 +271,7 @@ class VideoGenerationTool(BaseTool):
269
271
  },
270
272
  examples=[
271
273
  {
272
- "input": {"prompt": "samurai walking through rain", "frames": 33},
274
+ "input": {"prompt": "gentle breeze, swaying flowers", "image_url": "http://.../image.png"},
273
275
  "output": {"video_url": "http://...", "duration_seconds": 2.0}
274
276
  }
275
277
  ]
@@ -299,6 +301,7 @@ class VideoGenerationTool(BaseTool):
299
301
  prompt = inputs.get("prompt", "")
300
302
  style = inputs.get("style", "")
301
303
  motion = inputs.get("motion", "")
304
+ image_url = inputs.get("image_url")
302
305
 
303
306
  # Incorporate knowledge base hints
304
307
  if context and "technical_specs" in context:
@@ -316,15 +319,22 @@ class VideoGenerationTool(BaseTool):
316
319
  frames = inputs.get("frames", 33)
317
320
  fps = inputs.get("fps", 16)
318
321
 
322
+ # Choose capability based on whether we have a source image
323
+ if image_url:
324
+ capability = Capability.IMAGE_TO_VIDEO
325
+ else:
326
+ capability = Capability.TEXT_TO_VIDEO
327
+
319
328
  result = await backend.generate(GenerationRequest(
320
329
  prompt=prompt,
321
- capability=Capability.TEXT_TO_VIDEO,
330
+ capability=capability,
322
331
  negative_prompt=inputs.get("negative_prompt", ""),
323
332
  width=inputs.get("width", 832),
324
333
  height=inputs.get("height", 480),
325
334
  frames=frames,
326
335
  steps=20,
327
- cfg=5.0
336
+ cfg=5.0,
337
+ image_url=image_url # Pass source image for I2V
328
338
  ))
329
339
 
330
340
  if result.success:
vibe_aigc/vibe_backend.py CHANGED
@@ -41,6 +41,7 @@ class GenerationRequest:
41
41
  steps: int = 20
42
42
  cfg: float = 7.0
43
43
  seed: Optional[int] = None
44
+ image_url: Optional[str] = None # Source image for I2V/img2img
44
45
 
45
46
 
46
47
  @dataclass
@@ -150,10 +151,18 @@ class VibeBackend:
150
151
  import random
151
152
  request.seed = random.randint(0, 2**32 - 1)
152
153
 
153
- # Special handling for TEXT_TO_VIDEO: use I2V pipeline
154
+ # Special handling for video capabilities
154
155
  if request.capability == Capability.TEXT_TO_VIDEO:
155
156
  return await self._generate_video_via_i2v(request)
156
157
 
158
+ # IMAGE_TO_VIDEO: animate a provided image
159
+ if request.capability == Capability.IMAGE_TO_VIDEO:
160
+ if request.image_url:
161
+ return await self._animate_image(request)
162
+ else:
163
+ # No image provided, fall back to T2V pipeline
164
+ return await self._generate_video_via_i2v(request)
165
+
157
166
  # Try to get workflow
158
167
  workflow = await self._get_workflow(request)
159
168
  if not workflow:
@@ -467,6 +476,54 @@ class VibeBackend:
467
476
  print(f" Video: {video_result.output_path}")
468
477
  return video_result
469
478
 
479
+ async def _animate_image(self, request: GenerationRequest) -> GenerationResult:
480
+ """Animate an existing image with I2V.
481
+
482
+ Uses provided image_url instead of generating a new base image.
483
+ """
484
+ print(f"\n[I2V] Animating provided image...")
485
+ print(f" Source: {request.image_url}")
486
+
487
+ # Download the source image
488
+ async with aiohttp.ClientSession() as session:
489
+ async with session.get(request.image_url) as resp:
490
+ if resp.status != 200:
491
+ return GenerationResult(
492
+ success=False,
493
+ error=f"Failed to download image: HTTP {resp.status}"
494
+ )
495
+ image_data = await resp.read()
496
+
497
+ # Upload to ComfyUI
498
+ form = aiohttp.FormData()
499
+ form.add_field('image', image_data, filename='input.png', content_type='image/png')
500
+
501
+ async with session.post(f"{self.url}/upload/image", data=form) as resp:
502
+ upload_result = await resp.json()
503
+ uploaded_name = upload_result.get("name", "input.png")
504
+ print(f" Uploaded: {uploaded_name}")
505
+
506
+ # Create I2V workflow
507
+ i2v_workflow = self._create_wan_i2v_workflow(
508
+ uploaded_image=uploaded_name,
509
+ prompt=request.prompt,
510
+ negative=request.negative_prompt,
511
+ width=request.width,
512
+ height=request.height,
513
+ frames=request.frames,
514
+ seed=request.seed
515
+ )
516
+
517
+ video_result = await self._execute_workflow(i2v_workflow)
518
+ if not video_result.success:
519
+ return GenerationResult(
520
+ success=False,
521
+ error=f"Animation failed: {video_result.error}"
522
+ )
523
+
524
+ print(f" Video: {video_result.output_path}")
525
+ return video_result
526
+
470
527
  def _create_flux_image_workflow(
471
528
  self, prompt: str, negative: str, width: int, height: int, seed: int
472
529
  ) -> Dict[str, Any]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibe-aigc
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A New Paradigm for Content Generation via Agentic Orchestration
5
5
  Author: Vibe AIGC Contributors
6
6
  License-Expression: MIT
@@ -19,12 +19,12 @@ vibe_aigc/pipeline.py,sha256=sWoZq0mu9_ttLbzIJ0gZL8_1X9lH3iyK0mfi5VWufrQ,19032
19
19
  vibe_aigc/planner.py,sha256=TfndK417ZsoomDkDGGBx1SXDUUu8e_h5c4zELLIsNXQ,38448
20
20
  vibe_aigc/tools.py,sha256=crpUqqHEGQ7H-p5qfhYSCYgrIeR4Gx_2heEV_t9m6ak,17127
21
21
  vibe_aigc/tools_audio.py,sha256=cup4-Zo-cRTqnGAoWYmgQBK_tLl6sac7s9uSRyeZKNQ,25374
22
- vibe_aigc/tools_comfyui.py,sha256=XtPwAbQ6NcfgXjQokfPSc8aklMYFVRl51epwXZcWgjw,37924
22
+ vibe_aigc/tools_comfyui.py,sha256=hj-cP2k28KmL3DvsVIGVlvgJssavR-9vihdDc7W-eHg,38550
23
23
  vibe_aigc/tools_multimodal.py,sha256=asSJJqF0hrD9uNiYpuieVY-lbgEXjbK3UjT20nX2Lig,20405
24
24
  vibe_aigc/tools_utility.py,sha256=oDWursVXUhbxBdKFT0MmHS2Up9d8X0Ff16Cb0JREBGc,33754
25
25
  vibe_aigc/tools_video.py,sha256=zTaVMsz6E_R74CxnJ7iFfbB1othxi6EzokD1X6a-DTs,27800
26
26
  vibe_aigc/tools_vision.py,sha256=eItQ8feTsdbkVOlTZ67317IYu4t6OWHKmsO2w7sNp4A,43795
27
- vibe_aigc/vibe_backend.py,sha256=WStTXrtL73vSbqRA9hA72zcrV8Xt9gpZdQ0lk-M3lLw,24475
27
+ vibe_aigc/vibe_backend.py,sha256=YoBJrC-LcoVjHoDerxpeodNs9LvErr85KaJ6Q0fc5yA,26819
28
28
  vibe_aigc/video.py,sha256=0fg8RUpEsaJqDskAPiGP8yuyQDVCUvIy-uLScq_BOwg,14111
29
29
  vibe_aigc/visualization.py,sha256=jDs2f1vj4k8ZnJTA_niKLBH2NMahTgWneiADlNmW24s,7143
30
30
  vibe_aigc/vlm_feedback.py,sha256=AL_QJKLs80tsUcYhd1FwddI783j-ADVg_2xbK7vPOj4,19288
@@ -34,9 +34,9 @@ vibe_aigc/workflow_executor.py,sha256=mfYLOTfPmI7Upooxy07nPmlbZ-HZAfC18IaNW80G31
34
34
  vibe_aigc/workflow_registry.py,sha256=Z6gB1cA366LXqHcfqBF1od_8ySxAOt5RpKKaaZPqqUo,22359
35
35
  vibe_aigc/workflow_strategies.py,sha256=i_qqUrn-2F6lT9dNyFdTdy0NzE8ZnRNxAMl6zrOAtD8,26148
36
36
  vibe_aigc/workflows.py,sha256=uk7RjNVow6eimEdqfVQFDtLgHSkg0LUjSoa2N7C47u0,13886
37
- vibe_aigc-0.7.0.dist-info/licenses/LICENSE,sha256=Ir4dCTvOsbfoiOh9vYbhIKDH59S7J6qhJYZmHHICoKY,1079
38
- vibe_aigc-0.7.0.dist-info/METADATA,sha256=_TvMtrNMqPC5i9SeURKvmFcKleahr2HRA6x1K_nIbcQ,7391
39
- vibe_aigc-0.7.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
- vibe_aigc-0.7.0.dist-info/entry_points.txt,sha256=2htp4yXJMvCAQXTB39XWWwbBPP3MYUYXsqlwMeQsd7o,49
41
- vibe_aigc-0.7.0.dist-info/top_level.txt,sha256=Cpjz8X0WEhnhaigqxmsZSl9VxduaDspj7WuVUGGLeao,10
42
- vibe_aigc-0.7.0.dist-info/RECORD,,
37
+ vibe_aigc-0.7.1.dist-info/licenses/LICENSE,sha256=Ir4dCTvOsbfoiOh9vYbhIKDH59S7J6qhJYZmHHICoKY,1079
38
+ vibe_aigc-0.7.1.dist-info/METADATA,sha256=_TbKMeACL5FDeKXRQKhdkBkzdBOLm7L_PPf-3tU19b4,7391
39
+ vibe_aigc-0.7.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
+ vibe_aigc-0.7.1.dist-info/entry_points.txt,sha256=2htp4yXJMvCAQXTB39XWWwbBPP3MYUYXsqlwMeQsd7o,49
41
+ vibe_aigc-0.7.1.dist-info/top_level.txt,sha256=Cpjz8X0WEhnhaigqxmsZSl9VxduaDspj7WuVUGGLeao,10
42
+ vibe_aigc-0.7.1.dist-info/RECORD,,