ন্যানো কলা (চিত্র প্রজন্ম)

ন্যানো ব্যানানা হল জেমিনির নেটিভ ইমেজ জেনারেশন ক্ষমতার নাম। এটি বর্তমানে জেমিনি এপিআই-তে উপলব্ধ দুটি স্বতন্ত্র মডেলকে বোঝায়:

  • ন্যানো ব্যানানা : জেমিনি ২.৫ ফ্ল্যাশ ইমেজ মডেল ( gemini-2.5-flash-image )। এই মডেলটি গতি এবং দক্ষতার জন্য ডিজাইন করা হয়েছে, উচ্চ-ভলিউম, কম-বিলম্বিত কাজের জন্য অপ্টিমাইজ করা হয়েছে।
  • ন্যানো ব্যানানা প্রো : জেমিনি ৩ প্রো ইমেজ প্রিভিউ মডেল ( gemini-3-pro-image-preview )। এই মডেলটি পেশাদার সম্পদ উৎপাদনের জন্য ডিজাইন করা হয়েছে, জটিল নির্দেশাবলী অনুসরণ করতে এবং উচ্চ-বিশ্বস্ত পাঠ্য রেন্ডার করার জন্য উন্নত যুক্তি ("চিন্তা") ব্যবহার করে।

শুরু করুন

আপনি যে সংস্করণটি ব্যবহার করতে চান তার সাথে সঙ্গতিপূর্ণ মডেলের নাম ব্যবহার করে generate_content পদ্ধতি ব্যবহার করে ছবি তৈরি করতে পারেন।

পাইথন

from google import genai
from PIL import Image

client = genai.Client()

response = client.models.generate_content(
    model="gemini-2.5-flash-image",
    contents="Create a picture of a futuristic banana with neon lights in a cyberpunk city.",
)

for part in response.parts:
    if part.inline_data:
        image = part.as_image()
        image.show()

জাভাস্ক্রিপ্ট

import { GoogleGenAI } from "@google/genai";
import * as fs from "node:fs";

const ai = new GoogleGenAI({});

const response = await ai.models.generateContent({
  model: "gemini-2.5-flash-image",
  contents: "Create a picture of a futuristic banana with neon lights in a cyberpunk city.",
});

for (const part of response.candidates[0].content.parts) {
  if (part.inlineData) {
    const buffer = Buffer.from(part.inlineData.data, "base64");
    fs.writeFileSync("banana.png", buffer);
  }
}

যাও

package main

import (
    "context"
    "os"
    "google.golang.org/genai"
)

func main() {
    ctx := context.Background()
    client, err := genai.NewClient(ctx, nil)
    if err != nil {
        // handle error
    }

    resp, err := client.Models.GenerateContent(
        ctx,
        "gemini-2.5-flash-image",
        genai.Text("Create a picture of a futuristic banana with neon lights in a cyberpunk city."),
    )

    for _, part := range resp.Candidates[0].Content.Parts {
        if part.InlineData != nil {
            _ = os.WriteFile("banana.png", part.InlineData.Data, 0644)
        }
    }
}

জাভা

import com.google.genai.Client;
import com.google.genai.types.GenerateContentResponse;
import com.google.genai.types.Part;
import java.nio.file.Files;
import java.nio.file.Paths;

public class ImageGen {
  public static void main(String[] args) throws Exception {
    try (Client client = new Client()) {
      GenerateContentResponse response = client.models.generateContent(
          "gemini-2.5-flash-image",
          "Create a picture of a futuristic banana with neon lights in a cyberpunk city.",
          null);

      for (Part part : response.parts()) {
        if (part.inlineData().isPresent()) {
           Files.write(Paths.get("banana.png"), part.inlineData().get().data().get());
        }
      }
    }
  }
}

বিশ্রাম

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [
        {"text": "Create a picture of a futuristic banana with neon lights in a cyberpunk city."}
      ]
    }]
  }'

আরও জানুন

ছবি তৈরি, সম্পাদনা, উন্নত প্রম্পটিং এবং মডেল তুলনা সম্পর্কে বিস্তারিত ডকুমেন্টেশনের জন্য, অনুগ্রহ করে সম্পূর্ণ নির্দেশিকাটি দেখুন:

  • জেমিনি দিয়ে ছবি তৈরি : ন্যানো ব্যানানা এবং ন্যানো ব্যানানা প্রো মডেল ব্যবহারের সম্পূর্ণ নির্দেশিকা।
  • মডেল তথ্য : মডেল সংস্করণ, ক্ষমতা এবং মূল্য সম্পর্কে বিশদ বিবরণ।