Class: RunApi::IdeogramV3::Resources::EditImage
- Inherits:
-
Object
- Object
- RunApi::IdeogramV3::Resources::EditImage
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/ideogram_v3/resources/edit_image.rb
Overview
Inpaint with mask (model: ideogram-v3-edit).
Constant Summary collapse
- ENDPOINT =
"/api/v1/ideogram_v3/edit_image"- RESPONSE_CLASS =
Types::IdeogramResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedIdeogramResponse
- PROMPT_MAX_LENGTH =
5000
Instance Method Summary collapse
- #create(**params) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(http) ⇒ EditImage
constructor
A new instance of EditImage.
- #run(**params) ⇒ Object
Constructor Details
#initialize(http) ⇒ EditImage
Returns a new instance of EditImage.
15 16 17 |
# File 'lib/runapi/ideogram_v3/resources/edit_image.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
24 25 26 27 28 |
# File 'lib/runapi/ideogram_v3/resources/edit_image.rb', line 24 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ Object
30 31 32 |
# File 'lib/runapi/ideogram_v3/resources/edit_image.rb', line 30 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ Object
19 20 21 22 |
# File 'lib/runapi/ideogram_v3/resources/edit_image.rb', line 19 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |