Module: RubyLLM::Agents::ImageVariator::DSL
- Includes:
- Concerns::ImageOperationDSL
- Defined in:
- lib/ruby_llm/agents/image/variator/dsl.rb
Overview
DSL for configuring image variators
Provides class-level methods to configure model, size, variation strength, and other image variation parameters.
Instance Method Summary collapse
-
#size(value = nil) ⇒ String
Set or get the output image size.
-
#variation_strength(value = nil) ⇒ Float
Set or get the variation strength.
Methods included from Concerns::ImageOperationDSL
#cache_enabled?, #cache_for, #cache_ttl, #description, #model
Instance Method Details
#size(value = nil) ⇒ String
Set or get the output image size
28 29 30 31 32 33 34 |
# File 'lib/ruby_llm/agents/image/variator/dsl.rb', line 28 def size(value = nil) if value @size = value else @size || inherited_or_default(:size, config.default_image_size) end end |
#variation_strength(value = nil) ⇒ Float
Set or get the variation strength
Controls how different variations should be from the original. Higher values produce more diverse variations.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby_llm/agents/image/variator/dsl.rb', line 43 def variation_strength(value = nil) if value unless value.is_a?(Numeric) && value.between?(0.0, 1.0) raise ArgumentError, "Variation strength must be between 0.0 and 1.0" end @variation_strength = value.to_f else @variation_strength || inherited_or_default(:variation_strength, 0.5) end end |