Skip to content

feat: Add ModelsLab provider for image generation#15

Open
adhikjoshi wants to merge 1 commit intoalchaplinsky:mainfrom
adhikjoshi:add-modelslab-provider
Open

feat: Add ModelsLab provider for image generation#15
adhikjoshi wants to merge 1 commit intoalchaplinsky:mainfrom
adhikjoshi:add-modelslab-provider

Conversation

@adhikjoshi
Copy link

Summary

Adds ModelsLab as a new provider for image generation in gen-ai Ruby gem.

What this PR adds

  • New Provider: modelslab - Supports text-to-image generation via ModelsLab API
  • Uses the Flux model by default
  • Supports custom models, sizes, negative prompts, seeds, and other options

About ModelsLab

ModelsLab is a developer-first AI API platform providing:

  • Text-to-image generation (Flux, Stable Diffusion, etc.)
  • Text-to-video generation
  • Voice/audio synthesis
  • 3D generation
  • Image editing

Usage Example

require 'gen_ai'

# Initialize ModelsLab image client
model = GenAI::Image.new(:modelslab, ENV['MODELSLAB_API_KEY'])

# Generate an image
result = model.generate('A sunset over mountains in watercolor style')
File.write('sunset.png', result.value)

# With custom options
result = model.generate('A cat sitting on a couch', 
  size: '512x512',
  num_inference_steps: 40,
  negative_prompt: 'blurry, low quality')

API Documentation

- Add ModelsLab provider for text-to-image generation
- Supports Flux and other models via ModelsLab API
- Configuration: pass your ModelsLab API key as the token

Usage:
  model = GenAI::Image.new(:modelslab, ENV['MODELSLAB_API_KEY'])
  result = model.generate('A sunset over mountains')
  File.write('sunset.png', result.value)

Docs: https://docs.modelslab.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant