Class: RunApi::IdeogramV3::Resources::RemixImage

Inherits:
Object
  • Object
show all
Includes:
Core::ResourceHelpers
Defined in:
lib/runapi/ideogram_v3/resources/remix_image.rb

Overview

Image remix (model: ideogram-v3-remix).

Constant Summary collapse

ENDPOINT =
"/api/v1/ideogram_v3/remix_image"
RESPONSE_CLASS =
Types::IdeogramResponse
COMPLETED_RESPONSE_CLASS =
Types::CompletedIdeogramResponse
PROMPT_MAX_LENGTH =
5000
STRENGTH_MIN =
0.01
CHARACTER_REMIX_STRENGTH_MIN =
0.1
STRENGTH_MAX =
1.0

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ RemixImage

Returns a new instance of RemixImage.



18
19
20
# File 'lib/runapi/ideogram_v3/resources/remix_image.rb', line 18

def initialize(http)
  @http = http
end

Instance Method Details

#create(**params) ⇒ Object



27
28
29
30
31
# File 'lib/runapi/ideogram_v3/resources/remix_image.rb', line 27

def create(**params)
  params = compact_params(params)
  validate_params!(params)
  request(:post, ENDPOINT, body: params)
end

#get(id) ⇒ Object



33
34
35
# File 'lib/runapi/ideogram_v3/resources/remix_image.rb', line 33

def get(id)
  request(:get, "#{ENDPOINT}/#{id}")
end

#run(**params) ⇒ Object



22
23
24
25
# File 'lib/runapi/ideogram_v3/resources/remix_image.rb', line 22

def run(**params)
  task = create(**params)
  poll_until_complete { get(task.id) }
end