together-images

Generate and edit images via Together AI's image generation API. Models include FLUX.1 (schnell/dev/pro), FLUX.2, Kontext (image editing with reference images), Seedream, Stable Diffusion, and more. Use when users want to generate images from text, edit existing images, create AI art, use LoRA adapters for custom styles, or work with any image generation task.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "together-images" with this command: npx skills add zainhas/togetherai-skills/zainhas-togetherai-skills-together-images

Together Image Generation

Overview

Generate images from text prompts and edit existing images via the Together AI API.

  • Endpoint: /v1/images/generations
  • Response: URL or base64-encoded image
  • Models: FLUX.1 family, Kontext, Seedream, Stable Diffusion, and more

Installation

# Python (recommended)
uv init  # optional, if starting a new project
uv add together
# or with pip
pip install together
# TypeScript / JavaScript
npm install together-ai

Set your API key:

export TOGETHER_API_KEY=<your-api-key>

Quick Start

Text-to-Image

from together import Together
client = Together()

response = client.images.generate(
    prompt="A serene mountain landscape at sunset with a lake reflection",
    model="black-forest-labs/FLUX.1-schnell",
    steps=4,
)
print(f"Image URL: {response.data[0].url}")
import Together from "together-ai";
const together = new Together();

const response = await together.images.generate({
  prompt: "A serene mountain landscape at sunset with a lake reflection",
  model: "black-forest-labs/FLUX.1-schnell",
  steps: 4,
});
console.log(response.data[0].url);
curl -X POST "https://api.together.xyz/v1/images/generations" \
  -H "Authorization: Bearer $TOGETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"black-forest-labs/FLUX.1-schnell","prompt":"A serene mountain landscape","steps":4}'

Image Editing (Kontext)

Transform existing images using a reference:

response = client.images.generate(
    model="black-forest-labs/FLUX.1-kontext-pro",
    prompt="Transform this into a watercolor painting",
    image_url="https://cdn.pixabay.com/photo/2020/05/20/08/27/cat-5195431_1280.jpg",
    width=1024,
    height=768,
)
import Together from "together-ai";
const together = new Together();

const response = await together.images.generate({
  model: "black-forest-labs/FLUX.1-kontext-pro",
  width: 1024,
  height: 768,
  prompt: "Transform this into a watercolor painting",
  image_url: "https://cdn.pixabay.com/photo/2020/05/20/08/27/cat-5195431_1280.jpg",
});
curl -X POST "https://api.together.xyz/v1/images/generations" \
  -H "Authorization: Bearer $TOGETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "black-forest-labs/FLUX.1-kontext-pro",
    "width": 1024,
    "height": 768,
    "prompt": "Transform this into a watercolor painting",
    "image_url": "https://cdn.pixabay.com/photo/2020/05/20/08/27/cat-5195431_1280.jpg"
  }'

Multiple Variations

response = client.images.generate(
    prompt="A cute robot assistant",
    model="black-forest-labs/FLUX.1-schnell",
    n=4,
    steps=4,
)
for i, img in enumerate(response.data):
    print(f"Variation {i+1}: {img.url}")

Base64 Response

response = client.images.generate(
    model="black-forest-labs/FLUX.1-schnell",
    prompt="a cat in outer space",
    response_format="base64",
)
print(response.data[0].b64_json)
import Together from "together-ai";
const together = new Together();

const response = await together.images.generate({
  model: "black-forest-labs/FLUX.1-schnell",
  prompt: "a cat in outer space",
  response_format: "base64",
});
console.log(response.data[0].b64_json);
curl -X POST "https://api.together.xyz/v1/images/generations" \
  -H "Authorization: Bearer $TOGETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "black-forest-labs/FLUX.1-schnell",
    "prompt": "a cat in outer space",
    "response_format": "base64"
  }'

Parameters

ParameterTypeDescriptionDefault
promptstringText description (required)-
modelstringModel ID (required)-
widthintWidth in pixels1024
heightintHeight in pixels1024
nintNumber of images (1-4)1
stepsintDiffusion steps (more = better quality)varies
seedintRandom seed for reproducibilityrandom
negative_promptstringWhat to exclude-
response_formatstring"url" or "base64""url"
image_urlstringReference image (Kontext)-
aspect_ratiostringFor Schnell/Kontext models-
disable_safety_checkerboolDisable NSFW filterfalse

Notes:

  • Schnell and Kontext models use aspect_ratio; FLUX.1 Pro/Dev use width/height
  • Dimensions should be multiples of 8

Common Dimensions

Use CaseWidthHeight
Square (social media)10241024
Landscape (banners)1344768
Portrait (mobile)7681344

Steps Guide

  • 1-4 steps: Fast preview (Schnell)
  • 6-12 steps: Good quality
  • 20-30 steps: High quality
  • 30-50 steps: Maximum quality (diminishing returns)

Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

together-code-interpreter

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

together-code-sandbox

No summary provided by upstream source.

Repository SourceNeeds Review
General

together-audio

No summary provided by upstream source.

Repository SourceNeeds Review
General

together-evaluations

No summary provided by upstream source.

Repository SourceNeeds Review