naïve
Back to Primitives

2 actions · from $0.004 / image

Image generation

NaiveTool

Generate an image from a prompt, or change one you already have. Billed per image.

Part of AI models

Actions

Every action: POST /v1/tools/runs { "tool": "<name>", "input": { … } }

  • Image generation

    Generate image

    image.generate

    An image from a prompt.

    Parameters
    ParameterDescription
    prompt
    string · required
    Describe the image you want: subject, setting, style, light.
    aspect
    "1:1" | "4:5" | "16:9" | "9:16"
    Shape of the image: square, portrait, wide or tall.
    character
    string
    Draw a character you trained (its chr_ id or name), so the face stays the same across images.
    character_strength
    number
    0.5-1: how strictly the character's face is held. Only with character.
    Example response
    {
      "object": "image",
      "prompt": "a ceramic mug on a walnut desk, morning light",
      "aspect": "1:1",
      "url": "https://files.usenaive.ai/img_01JDX7.png",
      "width": 2048,
      "height": 2048
    }
    $0.004 / image
  • Image generation

    Edit image

    image.edit

    Change an image from a prompt.

    Parameters
    ParameterDescription
    image
    string · required
    Link to the image to change (https), or the file id (fil_…) of an image you made.
    prompt
    string · required
    What to change, in plain words.
    Example response
    {
      "object": "image",
      "url": "https://files.usenaive.ai/img_01JDX9.png"
    }
    $0.04 / image

Pricing

from $0.004 / image

Billed per call to one prepaid balance. No vendor accounts, no subscription.

Code

import { createNaive } from "@usenaive-sdk/naive"; const naive = createNaive(); // reads NAIVE_API_KEYconst run = await naive.tools.run("image.generate", {"prompt":"a ceramic mug on a walnut desk, morning light","aspect":"1:1"}, { wait: true });console.log(run.output);

Related tools

  • Naive

    Text or image to video with sound, 5–15 s.

    $0.05
    per second
    1 action
  • Naive

    Text to speech, dialogue, voice changer and voice isolation.

    from $0.002
    per second
    5 actions
  • Naive

    Instrumental tracks and sound effects.

    $0.0025
    per second
    1 action