Class: RunApi::Topaz::Client

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

Overview

Topaz AI upscaling client for increasing image and video resolution.

Examples:

client = RunApi::Topaz::Client.new(api_key: "sk-...")
result = client.upscale_image.run(
  model: "topaz-upscale-image",
  source_image_url: "https://example.com/photo.jpg",
  upscale_factor: 2
)
puts result.images.first.url

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Client.



21
22
23
24
25
# File 'lib/runapi/topaz/client.rb', line 21

def initialize(api_key: nil, **options)
  super
  @upscale_image = Resources::UpscaleImage.new(http)
  @upscale_video = Resources::UpscaleVideo.new(http)
end

Instance Attribute Details

#upscale_imageResources::UpscaleImage (readonly)

Returns AI-powered image upscaling (1x, 2x, 4x, 8x).

Returns:



17
18
19
# File 'lib/runapi/topaz/client.rb', line 17

def upscale_image
  @upscale_image
end

#upscale_videoResources::UpscaleVideo (readonly)

Returns AI-powered video upscaling (1x, 2x, 4x).

Returns:



19
20
21
# File 'lib/runapi/topaz/client.rb', line 19

def upscale_video
  @upscale_video
end