Prompt Chain

Compare Text-to-Image Models

Access text-to-image generation models through the ModelsLab API using promptfoo.

Works with modelslab

82
Spark score
out of 100
Updated 9 days ago
Version 0.121.19

Add to Favorites

Why it matters

Evaluate and compare the performance of various text-to-image generation models. This asset helps users select the best model for their specific image generation needs by providing a structured comparison.

Outcomes

What it gets done

01

Generate images using different text-to-image models.

02

Classify and compare the quality of generated images.

03

Integrate with the ModelsLab API for model access.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-provider-modelslab | bash

Steps

Steps in the chain

01
Get ModelsLab API key
02
Set environment variable
03
Initialize example project
04
Run evaluation
05
View results

Overview

Provider Modelslab

A promptfoo example that connects to the ModelsLab API for text-to-image generation. It includes setup instructions for obtaining an API key and commands to initialize and run the example. Use this when you want to integrate ModelsLab's text-to-image API with promptfoo. The example provides the basic setup and commands needed to get started.

What it does

This example demonstrates how to use text-to-image generation models through the ModelsLab API with promptfoo. It provides setup instructions and commands to get started with ModelsLab image generation.

When to use - and when NOT to

Use this example when you want to integrate ModelsLab's text-to-image API with promptfoo. Do NOT use this if you need real-time image generation in a production application without promptfoo.

Inputs and outputs

You provide text prompts describing the images you want to generate and configuration for which ModelsLab models to test. The system connects to the ModelsLab API to generate images based on your prompts.

Integrations

This example integrates with the ModelsLab API for accessing text-to-image generation models.

Setup and usage

First, obtain an API key from the ModelsLab dashboard and set it as an environment variable:

export MODELSLAB_API_KEY=your_api_key_here

Then initialize and run the example:

npx promptfoo@latest init --example provider-modelslab
npx promptfoo@latest eval
npx promptfoo@latest view

The init command sets up the example configuration, eval runs the evaluation, and view launches an interface to review results.

Who it's for

This example serves developers who want to use ModelsLab's text-to-image API with promptfoo.

Source README

provider-modelslab (ModelsLab Image Generation)

Compare text-to-image generation models using the ModelsLab API.

Setup

  1. Get an API key from ModelsLab
  2. Set the environment variable:
    export MODELSLAB_API_KEY=your_api_key_here
    

Usage

npx promptfoo@latest init --example provider-modelslab
npx promptfoo@latest eval
npx promptfoo@latest view

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.