Class: RunApi::Wan::Client

Inherits:
Core::Client
  • Object
show all
Defined in:
lib/runapi/wan/client.rb

Overview

Wan video and image generation API client.

Spans multiple generation families (2.2 through 2.7) with progressive capability upgrades. Feature availability varies by model variant.

Examples:

client = RunApi::Wan::Client.new(api_key: "your-api-key")
result = client.text_to_video.run(
  model: "wan-2.6-text-to-video",
  prompt: "A scenic mountain landscape with flowing rivers"
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, **options) ⇒ Client

Returns a new instance of Client.



30
31
32
33
34
35
36
37
38
39
# File 'lib/runapi/wan/client.rb', line 30

def initialize(api_key: nil, **options)
  super

  @text_to_video = Resources::TextToVideo.new(http)
  @image_to_video = Resources::ImageToVideo.new(http)
  @speech_to_video = Resources::SpeechToVideo.new(http)
  @animate = Resources::Animate.new(http)
  @text_to_image = Resources::TextToImage.new(http)
  @edit_video = Resources::EditVideo.new(http)
end

Instance Attribute Details

#animateResources::Animate (readonly)

Returns Transfer motion from a reference video onto a subject image (move or replace).

Returns:

  • (Resources::Animate)

    Transfer motion from a reference video onto a subject image (move or replace).



24
25
26
# File 'lib/runapi/wan/client.rb', line 24

def animate
  @animate
end

#edit_videoResources::EditVideo (readonly)

Returns Modify existing videos guided by text prompts and optional reference images.

Returns:

  • (Resources::EditVideo)

    Modify existing videos guided by text prompts and optional reference images.



28
29
30
# File 'lib/runapi/wan/client.rb', line 28

def edit_video
  @edit_video
end

#image_to_videoResources::ImageToVideo (readonly)

Returns Generate videos driven by a source image. Flash variants trade fidelity for speed.

Returns:



20
21
22
# File 'lib/runapi/wan/client.rb', line 20

def image_to_video
  @image_to_video
end

#speech_to_videoResources::SpeechToVideo (readonly)

Returns Generate lip-synced talking-head videos from a portrait image and speech audio.

Returns:



22
23
24
# File 'lib/runapi/wan/client.rb', line 22

def speech_to_video
  @speech_to_video
end

#text_to_imageResources::TextToImage (readonly)

Returns Generate images with optional color palette, bounding box, and thinking mode.

Returns:



26
27
28
# File 'lib/runapi/wan/client.rb', line 26

def text_to_image
  @text_to_image
end

#text_to_videoResources::TextToVideo (readonly)

Returns Generate videos from text prompts. Supports turbo (2.2) through 2.7 with progressive features.

Returns:

  • (Resources::TextToVideo)

    Generate videos from text prompts. Supports turbo (2.2) through 2.7 with progressive features.



18
19
20
# File 'lib/runapi/wan/client.rb', line 18

def text_to_video
  @text_to_video
end