How to generate AI images from the terminal with the Picsart CLI

SKILLS6 minBeginner

Learn to generate still images using Flux, Recraft, Nano Banana, and other models with aspect ratio and style control.

How to generate AI images from the terminal with the Picsart CLI

What you'll learn

  • Pick the right image model for photorealism vs. vector graphics
  • Control aspect ratios for social media and web formats
  • Generate multiple variations in one command
  • Save outputs to custom directories

What is CLI image generation?

CLI image generation lets you create AI images directly from your terminal using text prompts. The Picsart gen-ai CLI supports models like Flux (photorealism), Recraft (vector graphics), Nano Banana (speed), Imagen (Google's model), Seedream, and Ideogram. Instead of opening a web app and clicking through menus, you type one command and get your file. Think of it as Photoshop's "File → New" but the AI does the painting.

Common use cases

  • Social media: Generate 1:1 Instagram posts or 16:9 YouTube thumbnails on demand
  • Blog headers: Create 16:9 hero images that match your article topics
  • Marketing assets: Produce 20 variations of a product shot to A/B test
  • Prototyping: Mock up UI illustrations or brand concepts before design review
  • Batch campaigns: Generate a full set of launch visuals from a JSON manifest
  • OG images: Auto-create social preview images during Next.js or Gatsby builds

Generate AI images step by step

STEP 1: Open the CLI

  • On web: Go to picsart.com/cli → Install if you haven't already
  • On mobile: Not applicable — CLI runs in terminal only
Get the CLI

STEP 2: Choose your model and aspect ratio

Pick a model and specify dimensions:

  • Flux: Best for photorealistic images and product photography
  • Recraft: Best for vector-style graphics, logos, and illustrations
  • Nano Banana: Fastest generation, good for quick mockups
  • Aspect ratio flags: --ar 16:9, --ar 1:1, --ar 9:16, or custom like --ar 4:3

STEP 3: Run the generation

Type gen-ai generate with your prompt, model, and aspect ratio. The CLI creates the image and saves it to your current directory. Add --count to generate multiple variations at once.

STEP 4: Review and export

Check the generated image quality: Not perfect? Generate again with a refined prompt, switch models, or increase --count to get more options.

  • Verify the composition matches your prompt description
  • Check that aspect ratio is correct for your use case
  • Look for visual artifacts or off-brand elements
Start generating images

Tips for best results

💡 Use Flux for realistic product shots

Flux excels at photorealism — skin tones, reflections, shadows, and lighting all look natural. If your prompt describes a real-world scene or product, Flux is the safest choice. Recraft is better for flat, vector-style graphics.

💡 Specify aspect ratio upfront

Don't crop later — generate at the right size from the start. Use --ar 16:9 for blog headers and YouTube thumbnails, --ar 1:1 for Instagram posts, and --ar 9:16 for Stories or TikTok. The model composes the image differently based on the canvas shape.

💡 Generate multiple variations with --count

Add --count 5 or --count 10 to get several takes on the same prompt. You can pick the best one or use all of them for A/B testing. Batch generations run in parallel, so 10 images don't take 10× longer.

Aspect ratio guide

  • 16:9: YouTube thumbnails, blog headers, presentations
  • 1:1: Instagram posts, profile pictures, square graphics
  • 9:16: Instagram Stories, TikTok, mobile-first content
  • 4:5: Instagram feed optimization, Facebook posts
  • 2:3: Pinterest pins, vertical web banners
  • 21:9: Ultrawide desktop wallpapers, cinematic headers

Frequently asked questions

Flux generates photorealistic images with accurate lighting, textures, and natural compositions. Use it for product photography, portraits, or anything that should look like a real photo. Recraft produces vector-style illustrations with clean lines and flat colors. Use it for logos, icons, infographics, or graphic design assets.

Yes. Use --ar with any ratio like --ar 7:3 or specify exact pixel dimensions with --width 1920 --height 1080. The model adapts the composition to fit your canvas. For social media, stick to standard ratios (16:9, 1:1, 9:16) since platforms crop non-standard sizes.

Add --count followed by the number of variations you want. Example: gen-ai generate --prompt "sunset over mountains" --count 10 creates 10 different versions of the same prompt. All images save to your current directory with numbered filenames. Perfect for A/B testing or giving yourself options to choose from.

The CLI is free to install. Generations consume credits from your Picsart account. Free accounts get starter credits. Image generation costs 1-2 credits per image depending on the model and resolution. Run gen-ai estimate --prompt "your prompt" to check cost before generating.

Ready to generate images?

Install the CLI and start creating photorealistic or vector-style images in seconds.

Get started