runapi-infinitetalk 0.2.4 → 0.2.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4886911a34f5861168a03cef1d68c7805ea420b6dbf9a59c9bd80d2ed0c9e374
4
- data.tar.gz: b61ac858fb14128cc2c26060c3bc7f1cb08e447084c783332195d69f69902c73
3
+ metadata.gz: e1a267d42796d65befec17a0e733b2db482e18c440d38edfb7be16c1a1fae597
4
+ data.tar.gz: a2f1b73ad67eb6f5a34fafae990e9b411f41dd4bc235b12370bc9de3ef408a30
5
5
  SHA512:
6
- metadata.gz: 2c3fcab4e54358bc2fea170c5eb6ef9ccdabc1cbe16473c70d567668cfdd9a4de6731fa12772874bee4f3daf58616a674c13e9d0c4d758000d6e5c5f4cc43784
7
- data.tar.gz: 2ef816878703fb34146ed3d41c80caf57dc1f617e796d2d0f32d9f80c39a94024481a5900ead8f6a1ff6efda10db96c828926ec14ac39a74b77d89fd7437dce3
6
+ metadata.gz: c2d66db62701612624579a88be2603250e752722233cfd11d379c4e95488b6dcb403265a344edc9491569b2eb9a87b393d4e669d160eec155caf635a35ccf145
7
+ data.tar.gz: 2bf5dab96aa4bd2b640e8ec70b9bfc6c2ad3ba62e491f452c6e02f1c38b17719557e3f57833e5053d1218e0d2a1f581b070a5105f55bfd68f71cc50e498b08f3
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Infinitetalk API Ruby SDK for RunAPI
2
+
3
+ The infinitetalk api Ruby SDK is the language-specific package for InfiniteTalk on RunAPI. Use this infinitetalk api package for text-to-video, image-to-video, video editing, and animation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
+
5
+ This infinitetalk api README is the Ruby package guide inside the public `infinitalk-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/infinitalk; for API reference, use https://runapi.ai/docs#infinitalk; for SDK docs, use https://runapi.ai/docs#sdk-infinitalk.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-infinitalk
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-infinitalk"
17
+
18
+ client = RunApi::Infinitalk::Client.new
19
+ task = client.from_audios.create(
20
+ # Pass the InfiniteTalk JSON request body from https://runapi.ai/docs#infinitalk.
21
+ )
22
+ status = client.from_audios.get(task.id)
23
+ ```
24
+
25
+ Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
26
+
27
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
28
+
29
+ ## Language notes
30
+
31
+ Use Ruby keyword arguments and the `RunApi::Infinitalk` error classes when building video jobs, Rails workers, or scripts. The available resources include from audios. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
32
+
33
+ ## Links
34
+
35
+ - Model page: https://runapi.ai/models/infinitalk
36
+ - SDK docs: https://runapi.ai/docs#sdk-infinitalk
37
+ - Product docs: https://runapi.ai/docs#infinitalk
38
+ - Pricing and rate limits: https://runapi.ai/models/infinitalk
39
+ - Provider comparison: https://runapi.ai/providers/meigen-ai
40
+ - Full catalog: https://runapi.ai/models
41
+ - Repository: https://github.com/runapi-ai/infinitalk-sdk
42
+
43
+ ## License
44
+
45
+ Licensed under the Apache License, Version 2.0.
@@ -2,14 +2,24 @@
2
2
 
3
3
  module RunApi
4
4
  module Infinitetalk
5
- class Client
5
+ # InfiniteTalk lip-sync video generation client. Produces talking-head videos
6
+ # by animating a portrait image to match an audio track's speech or singing.
7
+ #
8
+ # @example
9
+ # client = RunApi::Infinitetalk::Client.new(api_key: "sk-...")
10
+ # result = client.audio_to_video.run(
11
+ # model: "infinitetalk-from-audio",
12
+ # source_image_url: "https://example.com/portrait.jpg",
13
+ # source_audio_url: "https://example.com/voice.mp3",
14
+ # prompt: "A young woman talking on a podcast"
15
+ # )
16
+ # puts result.videos.first.url
17
+ class Client < RunApi::Core::Client
18
+ # @return [Resources::AudioToVideo] Lip-synced video generation from a portrait image and audio track.
6
19
  attr_reader :audio_to_video
7
20
 
8
21
  def initialize(api_key: nil, **options)
9
- @api_key = Core::Auth.resolve_api_key(api_key)
10
-
11
- client_options = Core::ClientOptions.new(api_key: @api_key, **options)
12
- http = client_options.http_client || Core::HttpClient.new(client_options)
22
+ super
13
23
  @audio_to_video = Resources::AudioToVideo.new(http)
14
24
  end
15
25
  end
@@ -3,6 +3,8 @@
3
3
  module RunApi
4
4
  module Infinitetalk
5
5
  module Resources
6
+ # Generates lip-synced talking-head videos from a portrait image and an audio track.
7
+ # The output video shows the person speaking or singing in sync with the audio.
6
8
  class AudioToVideo
7
9
  include RunApi::Core::ResourceHelpers
8
10
 
@@ -40,15 +42,15 @@ module RunApi
40
42
  raise Core::ValidationError, "Invalid model: #{model}. Must be one of: #{Types::MODELS.join(", ")}"
41
43
  end
42
44
 
43
- validate_required!(params, :image_url)
44
- validate_required!(params, :audio_url)
45
+ validate_required!(params, :source_image_url)
46
+ validate_required!(params, :source_audio_url)
45
47
  prompt = param(params, :prompt)
46
48
  raise Core::ValidationError, "prompt is required" unless prompt.is_a?(String) && !prompt.empty?
47
49
  if prompt.length > PROMPT_MAX_LENGTH
48
50
  raise Core::ValidationError, "prompt must be at most #{PROMPT_MAX_LENGTH} characters"
49
51
  end
50
52
 
51
- validate_optional!(params, :resolution, Types::RESOLUTIONS)
53
+ validate_optional!(params, :output_resolution, Types::RESOLUTIONS)
52
54
 
53
55
  seed = param(params, :seed)
54
56
  return if seed.nil?
@@ -3,22 +3,28 @@
3
3
  module RunApi
4
4
  module Infinitetalk
5
5
  module Types
6
+ # Available model identifiers for audio-to-video generation.
6
7
  MODELS = %w[infinitetalk-from-audio].freeze
8
+ # Output resolution options. Higher resolution increases fidelity but takes longer.
7
9
  RESOLUTIONS = %w[480p 720p].freeze
8
10
 
11
+ # A generated video asset.
9
12
  class Video < RunApi::Core::BaseModel
10
13
  optional :url, String
11
14
  end
12
15
 
16
+ # Result of an audio-to-video generation task.
17
+ # While processing, +videos+ is nil; once completed, it contains the generated lip-synced video(s).
13
18
  class AudioToVideoResponse < RunApi::Core::TaskResponse
14
19
  required :id, String
15
20
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
16
- optional :videos, [ -> { Video } ]
21
+ optional :videos, [-> { Video }]
17
22
  optional :error, String
18
23
  end
19
24
 
25
+ # Narrowed response type guaranteed to contain completed videos.
20
26
  class CompletedAudioToVideoResponse < AudioToVideoResponse
21
- required :videos, [ -> { Video } ]
27
+ required :videos, [-> { Video }]
22
28
  end
23
29
  end
24
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-infinitetalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,22 +15,27 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.4
18
+ version: 0.2.6
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.4
26
- description: RunAPI InfiniteTalk SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.6
26
+ description: The infinitetalk api Ruby SDK is the language-specific package for InfiniteTalk
27
+ on RunAPI. Use this infinitetalk api package for text-to-video, image-to-video,
28
+ video editing, and animation flows when your application needs JSON request bodies,
29
+ task status lookup, and consistent RunAPI errors in Ruby.
27
30
  email:
28
31
  - contact@runapi.ai
29
32
  executables: []
30
33
  extensions: []
31
- extra_rdoc_files: []
34
+ extra_rdoc_files:
35
+ - README.md
32
36
  files:
33
37
  - LICENSE
38
+ - README.md
34
39
  - lib/runapi-infinitetalk.rb
35
40
  - lib/runapi/infinitetalk.rb
36
41
  - lib/runapi/infinitetalk/client.rb
@@ -41,7 +46,7 @@ licenses:
41
46
  - Apache-2.0
42
47
  metadata:
43
48
  homepage_uri: https://runapi.ai/models/infinitetalk
44
- documentation_uri: https://github.com/runapi-ai/infinitetalk-sdk/blob/main/README.md
49
+ documentation_uri: https://github.com/runapi-ai/infinitetalk-sdk/blob/main/ruby/README.md
45
50
  source_code_uri: https://github.com/runapi-ai/infinitetalk-sdk
46
51
  changelog_uri: https://github.com/runapi-ai/infinitetalk-sdk/blob/main/CHANGELOG.md
47
52
  rdoc_options: []
@@ -60,5 +65,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
65
  requirements: []
61
66
  rubygems_version: 4.0.10
62
67
  specification_version: 4
63
- summary: InfiniteTalk API SDKs for JavaScript, Ruby, and Go on RunAPI.
68
+ summary: Infinitetalk API Ruby SDK for RunAPI
64
69
  test_files: []