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
STRENGTH_MAX =
1.0

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ RemixImage

Returns a new instance of RemixImage.



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

def initialize(http)
  @http = http
end

Instance Method Details

#create(**params) ⇒ Object



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

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

#get(id) ⇒ Object



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

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

#run(**params) ⇒ Object



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

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