runapi-ideogram-v3 0.2.6 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc1b721eb9666ebffa9d974a30ffb4f015b4d69ca74ead610686c17b6b0bcff2
4
- data.tar.gz: 786042996e23818cdb4bc76eb869812176acd99415210cff8ddd68bdb16bea17
3
+ metadata.gz: dde03331810a873fb90e94add731e8b5ba2fb708b65793635ba116c62da37097
4
+ data.tar.gz: 30b5662428e00828dbe82f6a86c3d606cd250a1146bc2587bf634bda637985dd
5
5
  SHA512:
6
- metadata.gz: 8f266081742ba4681706682f442ede15030f87414320db93931a0ecf01bc4c93de779b8bbdf373bd82c0c9a5476aade094f3e53c53bd20c2c606f37974a64496
7
- data.tar.gz: 67f3908f740aea4409b719a265b019d5da5fdd538ff5e2ddd4b02173ec5b7c01b22c452ead216da9f663c1717996a9b381696d3447e8fff8b0e1d87f08c8d1cc
6
+ metadata.gz: 844c94f0cc39f4f591ea2cef59d31f7db91b0a33e0901df371e027b3bb14e80ff12cacb73c295b039894a3236b6f047fee0d9ce6fa7b046b590c6502246677c9
7
+ data.tar.gz: 32848ec85bbdc5d9b57e2e45215260a0652a40053a9d7584061d6aeebabaa8ebc46cf96f831bfd55d7513d9a90b6ed22479e6c0c5842f1948cdb81f6e96db771
data/README.md CHANGED
@@ -25,6 +25,8 @@ status = client.text_to_image.get(task.id)
25
25
 
26
26
  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.
27
27
 
28
+ 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.
29
+
28
30
  ## Language notes
29
31
 
30
32
  Use Ruby keyword arguments and the `RunApi::IdeogramV3` error classes when building image jobs, Rails workers, or scripts. The available resources are `text_to_image`, `edit_image`, `remix_image`, and `reframe_image`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
@@ -4,24 +4,27 @@ module RunApi
4
4
  module IdeogramV3
5
5
  # Ideogram V3 image generation API client.
6
6
  #
7
+ # Supports text-to-image, inpaint editing, remix, and reframe operations.
8
+ # Character model variants add character consistency from reference images.
9
+ #
7
10
  # @example
8
11
  # client = RunApi::IdeogramV3::Client.new(api_key: "your-api-key")
9
12
  # result = client.text_to_image.run(
10
13
  # model: "ideogram-v3-text-to-image",
11
14
  # prompt: "A cinematic lakeside at twilight"
12
15
  # )
13
- class Client
14
- # @return [Resources::TextToImage] Text-to-image operations.
15
- # @return [Resources::EditImage] Inpaint-with-mask operations.
16
- # @return [Resources::RemixImage] Image remix operations.
17
- # @return [Resources::ReframeImage] Image reframe operations.
18
- attr_reader :text_to_image, :edit_image, :remix_image, :reframe_image
16
+ class Client < RunApi::Core::Client
17
+ # @return [Resources::TextToImage] Text-to-image generation operations.
18
+ attr_reader :text_to_image
19
+ # @return [Resources::EditImage] Inpaint-with-mask editing operations.
20
+ attr_reader :edit_image
21
+ # @return [Resources::RemixImage] Prompt-guided image variation operations.
22
+ attr_reader :remix_image
23
+ # @return [Resources::ReframeImage] Aspect ratio reframing operations.
24
+ attr_reader :reframe_image
19
25
 
20
26
  def initialize(api_key: nil, **options)
21
- @api_key = Core::Auth.resolve_api_key(api_key)
22
-
23
- client_options = Core::ClientOptions.new(api_key: @api_key, **options)
24
- http = client_options.http_client || Core::HttpClient.new(client_options)
27
+ super
25
28
  @text_to_image = Resources::TextToImage.new(http)
26
29
  @edit_image = Resources::EditImage.new(http)
27
30
  @remix_image = Resources::RemixImage.new(http)
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module IdeogramV3
5
5
  module Resources
6
- # Inpaint with mask (model: ideogram-v3-edit).
6
+ # Inpaint editing using a mask to define the regenerated region.
7
7
  class EditImage
8
8
  include RunApi::Core::ResourceHelpers
9
9
 
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module IdeogramV3
5
5
  module Resources
6
- # Reframe an input image (model: ideogram-v3-reframe).
6
+ # Extends or crops an image to a new aspect ratio without regenerating content.
7
7
  class ReframeImage
8
8
  include RunApi::Core::ResourceHelpers
9
9
 
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module IdeogramV3
5
5
  module Resources
6
- # Image remix (model: ideogram-v3-remix).
6
+ # Creates a variation of a source image guided by a new text prompt.
7
7
  class RemixImage
8
8
  include RunApi::Core::ResourceHelpers
9
9
 
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module IdeogramV3
5
5
  module Resources
6
- # Text-to-image generation (model: ideogram-v3-text-to-image).
6
+ # Generates images from text with configurable speed, style, and aspect ratio.
7
7
  class TextToImage
8
8
  include RunApi::Core::ResourceHelpers
9
9
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module RunApi
4
4
  module IdeogramV3
5
+ # Type definitions and constants for Ideogram V3.
6
+ # Character model variants add character consistency from reference images.
5
7
  module Types
6
8
  GENERATION_MODEL = "ideogram-v3-text-to-image"
7
9
  EDIT_MODEL = "ideogram-v3-edit"
@@ -11,16 +13,23 @@ module RunApi
11
13
  CHARACTER_REMIX_MODEL = "ideogram-v3-character-remix"
12
14
  REFRAME_MODEL = "ideogram-v3-reframe"
13
15
 
16
+ # Speed-quality tradeoff: turbo is fastest, quality is highest fidelity.
14
17
  RENDERING_SPEEDS = %w[turbo balanced quality].freeze
18
+ # Visual style presets for standard (non-character) models.
15
19
  STYLES = %w[auto general realistic design].freeze
20
+ # Visual style presets for character-consistency models.
16
21
  CHARACTER_STYLES = %w[auto realistic fiction].freeze
17
22
  ASPECT_RATIOS = %w[1:1 3:4 9:16 4:3 16:9].freeze
23
+ # Number of images per request (1-4).
18
24
  OUTPUT_COUNTS = [1, 2, 3, 4].freeze
19
25
 
26
+ # A single generated image with its CDN URL.
20
27
  class Image < RunApi::Core::BaseModel
21
28
  optional :url, String
22
29
  end
23
30
 
31
+ # Normalized response for all Ideogram V3 endpoints.
32
+ # +images+ is populated once +status+ is +"completed"+.
24
33
  class IdeogramResponse < RunApi::Core::TaskResponse
25
34
  required :id, String
26
35
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-ideogram-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
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.5
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.5
25
+ version: 0.2.6
26
26
  description: The ideogram api Ruby SDK is the language-specific package for Ideogram
27
27
  V3 on RunAPI. Use this ideogram api package for text-to-image, character reference
28
28
  generation, edit, remix, reframe, and creative production flows when your application