runapi-infinitetalk 0.2.5 → 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 +4 -4
- data/README.md +2 -0
- data/lib/runapi/infinitetalk/client.rb +15 -5
- data/lib/runapi/infinitetalk/resources/audio_to_video.rb +2 -0
- data/lib/runapi/infinitetalk/types.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1a267d42796d65befec17a0e733b2db482e18c440d38edfb7be16c1a1fae597
|
|
4
|
+
data.tar.gz: a2f1b73ad67eb6f5a34fafae990e9b411f41dd4bc235b12370bc9de3ef408a30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2d66db62701612624579a88be2603250e752722233cfd11d379c4e95488b6dcb403265a344edc9491569b2eb9a87b393d4e669d160eec155caf635a35ccf145
|
|
7
|
+
data.tar.gz: 2bf5dab96aa4bd2b640e8ec70b9bfc6c2ad3ba62e491f452c6e02f1c38b17719557e3f57833e5053d1218e0d2a1f581b070a5105f55bfd68f71cc50e498b08f3
|
data/README.md
CHANGED
|
@@ -24,6 +24,8 @@ status = client.from_audios.get(task.id)
|
|
|
24
24
|
|
|
25
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
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
|
+
|
|
27
29
|
## Language notes
|
|
28
30
|
|
|
29
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.
|
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Infinitetalk
|
|
5
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -3,13 +3,18 @@
|
|
|
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 }
|
|
@@ -17,6 +22,7 @@ module RunApi
|
|
|
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
27
|
required :videos, [-> { Video }]
|
|
22
28
|
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
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RunAPI
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.2.
|
|
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.
|
|
25
|
+
version: 0.2.6
|
|
26
26
|
description: The infinitetalk api Ruby SDK is the language-specific package for InfiniteTalk
|
|
27
27
|
on RunAPI. Use this infinitetalk api package for text-to-video, image-to-video,
|
|
28
28
|
video editing, and animation flows when your application needs JSON request bodies,
|