Class: RubyLLM::Agents::ImageVariator
- Inherits:
-
Object
- Object
- RubyLLM::Agents::ImageVariator
- Extended by:
- DSL
- Includes:
- Execution
- Defined in:
- lib/ruby_llm/agents/image/variator.rb,
lib/ruby_llm/agents/image/variator/dsl.rb,
lib/ruby_llm/agents/image/variator/execution.rb
Overview
Image variator for generating variations of existing images
Creates variations of an input image while maintaining the overall composition and style. Useful for exploring design alternatives or generating A/B test variants.
Defined Under Namespace
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Class Method Summary collapse
-
.call(image:, **options) ⇒ ImageVariationResult
Execute image variation with the given source image.
-
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings.
Instance Method Summary collapse
-
#call ⇒ ImageVariationResult
Execute the image variation.
-
#initialize(image:, **options) ⇒ ImageVariator
constructor
Initialize a new image variator instance.
Methods included from Execution
Constructor Details
#initialize(image:, **options) ⇒ ImageVariator
Initialize a new image variator instance
66 67 68 69 70 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 66 def initialize(image:, **) @image = image @options = @tenant_id = nil end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
55 56 57 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 55 def image @image end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
55 56 57 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 55 def @options end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
55 56 57 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 55 def tenant_id @tenant_id end |
Class Method Details
.call(image:, **options) ⇒ ImageVariationResult
Execute image variation with the given source image
39 40 41 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 39 def call(image:, **) new(image: image, **).call end |
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings
44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 44 def inherited(subclass) super subclass.instance_variable_set(:@model, @model) subclass.instance_variable_set(:@size, @size) subclass.instance_variable_set(:@variation_strength, @variation_strength) subclass.instance_variable_set(:@version, @version) subclass.instance_variable_set(:@description, @description) subclass.instance_variable_set(:@cache_ttl, @cache_ttl) end |
Instance Method Details
#call ⇒ ImageVariationResult
Execute the image variation
75 76 77 |
# File 'lib/ruby_llm/agents/image/variator.rb', line 75 def call execute end |