Class: ModelsLab::Enterprise

Inherits:
Object
  • Object
show all
Defined in:
lib/modelslab/enterprise.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Enterprise

Returns a new instance of Enterprise.



5
6
7
# File 'lib/modelslab/enterprise.rb', line 5

def initialize(client:)
  @client = client
end

Instance Method Details

#fetch_queued_image(request_id:) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/modelslab/enterprise.rb', line 19

def fetch_queued_image(request_id:)
  parameters = {
    key: @client.api_key,
    request_id: request_id
  }

  @client.json_post(path: "v1/enterprise/fetch", parameters: parameters)
end

#text2img(prompt:, model_id:, options: {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/modelslab/enterprise.rb', line 9

def text2img(prompt:, model_id:, options: {})
  parameters = {
    key: @client.api_key,
    prompt: prompt,
    model_id: model_id
  }.merge(options)

  @client.json_post(path: "v1/enterprise/text2img", parameters: parameters)
end