Class: RunApi::Flux2::Client

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

Overview

Flux 2 text-to-image and remix API client.

Pro and flex tiers for both text-to-image generation and text-guided image remixing.

Examples:

client = RunApi::Flux2::Client.new(api_key: "your-api-key")
result = client.text_to_image.run(
  model: "flux-2-pro-text-to-image", prompt: "A futuristic cityscape"
)

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/flux_2/client.rb', line 21

def initialize(api_key: nil, **options)
  super
  @text_to_image = Resources::TextToImage.new(http)
  @remix_image = Resources::RemixImage.new(http)
end

Instance Attribute Details

#remix_imageResources::RemixImage (readonly)

Returns Image remix operations with text-guided transformations.

Returns:



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

def remix_image
  @remix_image
end

#text_to_imageResources::TextToImage (readonly)

Returns Text-to-image generation operations.

Returns:



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

def text_to_image
  @text_to_image
end