Sha256: 3ccff1765d68b2a60351a21b91d502f4a5cfc8295e781fd9575b86cb9396cc79

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require_relative "base"

module Roseflow
  module StabilityAI
    module Operations
      class TextToImage < Base
        attribute :height, Types::Integer.default(512)
        attribute :width, Types::Integer.default(512)
        attribute :text_prompts, Types::Array do
          attribute :text, Types::String
          attribute :weight, Types::Float.default(1.0)
        end
        attribute :cfg_scale, Types::Integer.default(7)
        attribute :clip_guidance_preset, Types::String.default("NONE")
        attribute? :sampler, Types::String
        attribute :samples, Types::Integer.default(1)
        attribute :seed, Types::Integer.default(0)
        attribute :steps, Types::Integer.default(50)
        attribute? :style_preset, Types::String.default("photographic")

        def type
          :text_to_image
        end

        def multipart?
          false
        end

        def path
          "/v1/generation/#{engine_id}/text-to-image"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roseflow-stabilityai-0.1.0 lib/roseflow/stabilityai/operations/text_to_image.rb