feat: Add ModelsLab provider for image generation#918
Open
adhikjoshi wants to merge 1 commit intoprism-php:mainfrom
Open
feat: Add ModelsLab provider for image generation#918adhikjoshi wants to merge 1 commit intoprism-php:mainfrom
adhikjoshi wants to merge 1 commit intoprism-php:mainfrom
Conversation
Adds ModelsLab as a new provider for text-to-image generation in Prism.
Changes:
- src/Enums/Provider.php: Add ModelsLab case
- src/Providers/ModelsLab/ModelsLab.php: Provider class with images() method
- src/Providers/ModelsLab/Handlers/Images.php: Image generation handler
- src/PrismManager.php: Add createModelslabProvider factory method
- config/prism.php: Add modelslab config with MODELSLAB_API_KEY
Supports Flux, SDXL, and community models via ModelsLab REST API.
API key goes in request body (not Bearer token).
Usage:
Prism::images()
->using('modelslab', [api_key => 'your-key'])
->generate('A sunset over mountains')
API docs: https://docs.modelslab.com/image-generation/overview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds ModelsLab as a new image generation provider in Prism — a unified AI interface for Laravel.
What this PR adds
Provider class (
src/Providers/ModelsLab/ModelsLab.php)images()method following the Provider interfaceImage handler (
src/Providers/ModelsLab/Handlers/Images.php)"key": "api_key", not Bearer token)Configuration (
config/prism.php)Usage
Supported provider options
width(default: 1024)height(default: 1024)samples(default: 1)num_inference_steps(default: 30)guidance_scale(default: 7.5)negative_promptseedsafety_checker(default: "no")API Reference