Image Prompt Example

This example demonstrates how to use an AI model (e.g., SDXL, Imagen, Flux) to generate an image using a prompt and negative prompt input. It uses the imagen model by default.

Demonstrates

Upload Required

No upload required. This is a No-Upload Job. Uncheck the "Upload required" box in the template settings to enable this mode. When creating a job, select "No-Upload Job" to skip the upload step and go straight to the field inputs.

Fields

fields:
  - field:
      name: "prompt"
      type: "textarea"
      label: "Image Prompt"
      placeholder: "Enter image description…"
      filter: "maxlen(255)"
      validate: "minlength(5);maxlength(255)"
      error_message: "At least 5 characters. 255 character max."
      vars:
        prompt: "{value}"

  - field:
      name: "neg_prompt"
      type: "textarea"
      label: "Negative Prompt"
      placeholder: "Enter negative prompt…"
      filter: "maxlen(255)"
      vars:
        neg_prompt: "{value}"

Definition

- processor: # use AI to generate an image
    processor: "text_to_image"
    params:
      model: "imagen" # options: "flux", "sdxl", "imagen", "imagen-fast", "imagen-ultra"
      prompt: "{var:prompt}"
      negative_prompt: "{var:neg_prompt}"
      width: "1500"
      height: "1125"
    outputs:
      target: "output/output.png"