মিথুন কথোপকথনে ছবি তৈরি এবং প্রক্রিয়া করতে পারে। আপনি টেক্সট, ছবি বা উভয়ের সংমিশ্রণে মিথুনকে প্রম্পট করতে পারেন যা আপনাকে অভূতপূর্ব নিয়ন্ত্রণের সাথে ভিজ্যুয়াল তৈরি, সম্পাদনা এবং পুনরাবৃত্তি করতে দেয়:
- টেক্সট-টু-ইমেজ: সহজ বা জটিল টেক্সট বর্ণনা থেকে উচ্চ-মানের ছবি তৈরি করুন।
- ইমেজ + টেক্সট-টু-ইমেজ (সম্পাদনা): একটি ইমেজ প্রদান করুন এবং উপাদান যোগ করতে, অপসারণ করতে বা পরিবর্তন করতে, স্টাইল পরিবর্তন করতে বা কালার গ্রেডিং সামঞ্জস্য করতে টেক্সট প্রম্পট ব্যবহার করুন।
- মাল্টি-ইমেজ টু ইমেজ (কম্পোজিশন এবং স্টাইল ট্রান্সফার): একটি নতুন দৃশ্য রচনা করতে বা একটি ইমেজ থেকে অন্য ছবিতে স্টাইল স্থানান্তর করতে একাধিক ইনপুট ইমেজ ব্যবহার করুন।
- পুনরাবৃত্ত পরিমার্জন: আপনার ইমেজটি নিখুঁত না হওয়া পর্যন্ত ছোটখাটো সমন্বয় করে, একাধিক বাঁক ধরে ক্রমান্বয়ে পরিমার্জিত করতে একটি কথোপকথনে জড়িত হন।
- হাই-ফিডেলিটি টেক্সট রেন্ডারিং: লোগো, ডায়াগ্রাম এবং পোস্টারের জন্য আদর্শ, সুস্পষ্ট এবং ভালভাবে স্থাপন করা টেক্সট ধারণ করে সঠিকভাবে ছবি তৈরি করুন।
সমস্ত জেনারেট করা ছবিতে একটি SynthID ওয়াটারমার্ক অন্তর্ভুক্ত।
ছবি তৈরি (টেক্সট থেকে ইমেজ)
একটি বর্ণনামূলক প্রম্পটের উপর ভিত্তি করে একটি চিত্র কীভাবে তৈরি করা যায় তা নিম্নলিখিত কোডটি প্রদর্শন করে।
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
prompt = (
"Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"
)
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[prompt],
)
for part in response.candidates[0].content.parts:
if part.text is not None:
print(part.text)
elif part.inline_data is not None:
image = Image.open(BytesIO(part.inline_data.data))
image.save("generated_image.png")
জাভাস্ক্রিপ্ট
import { GoogleGenAI, Modality } from "@google/genai";
import * as fs from "node:fs";
async function main() {
const ai = new GoogleGenAI({});
const prompt =
"Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme";
const response = await ai.models.generateContent({
model: "gemini-2.5-flash-image-preview",
contents: prompt,
});
for (const part of response.candidates[0].content.parts) {
if (part.text) {
console.log(part.text);
} else if (part.inlineData) {
const imageData = part.inlineData.data;
const buffer = Buffer.from(imageData, "base64");
fs.writeFileSync("gemini-native-image.png", buffer);
console.log("Image saved as gemini-native-image.png");
}
}
}
main();
যাও
package main
import (
"context"
"fmt"
"os"
"google.golang.org/genai"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
result, _ := client.Models.GenerateContent(
ctx,
"gemini-2.5-flash-image-preview",
genai.Text("Create a picture of a nano banana dish in a " +
" fancy restaurant with a Gemini theme"),
)
for _, part := range result.Candidates[0].Content.Parts {
if part.Text != "" {
fmt.Println(part.Text)
} else if part.InlineData != nil {
imageBytes := part.InlineData.Data
outputFilename := "gemini_generated_image.png"
_ = os.WriteFile(outputFilename, imageBytes, 0644)
}
}
}
বিশ্রাম
curl -s -X POST
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [
{"text": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}
]
}]
}' \
| grep -o '"data": "[^"]*"' \
| cut -d'"' -f4 \
| base64 --decode > gemini-native-image.png

ইমেজ এডিটিং (টেক্সট-এবং ইমেজ থেকে ইমেজ)
অনুস্মারক : নিশ্চিত করুন যে আপনার আপলোড করা যেকোনো চিত্রের প্রয়োজনীয় অধিকার রয়েছে। এমন সামগ্রী তৈরি করবেন না যা অন্যের অধিকার লঙ্ঘন করে, ভিডিও বা ছবি সহ যা প্রতারণা, হয়রানি বা ক্ষতি করে। এই জেনারেটিভ এআই পরিষেবার আপনার ব্যবহার আমাদের নিষিদ্ধ ব্যবহারের নীতির সাপেক্ষে৷
ছবি সম্পাদনা করতে, ইনপুট হিসাবে একটি ছবি যোগ করুন। নিচের উদাহরণটি বেস64 এনকোড করা ছবি আপলোড করা দেখায়। একাধিক ছবি, বৃহত্তর পেলোড এবং সমর্থিত MIME প্রকারের জন্য, চিত্র বোঝার পৃষ্ঠাটি দেখুন।
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
prompt = (
"Create a picture of my cat eating a nano-banana in a "
"fancy restaurant under the Gemini constellation",
)
image = Image.open("/path/to/cat_image.png")
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[prompt, image],
)
for part in response.candidates[0].content.parts:
if part.text is not None:
print(part.text)
elif part.inline_data is not None:
image = Image.open(BytesIO(part.inline_data.data))
image.save("generated_image.png")
জাভাস্ক্রিপ্ট
import { GoogleGenAI, Modality } from "@google/genai";
import * as fs from "node:fs";
async function main() {
const ai = new GoogleGenAI({});
const imagePath = "path/to/cat_image.png";
const imageData = fs.readFileSync(imagePath);
const base64Image = imageData.toString("base64");
const prompt = [
{ text: "Create a picture of my cat eating a nano-banana in a" +
"fancy restaurant under the Gemini constellation" },
{
inlineData: {
mimeType: "image/png",
data: base64Image,
},
},
];
const response = await ai.models.generateContent({
model: "gemini-2.5-flash-image-preview",
contents: prompt,
});
for (const part of response.candidates[0].content.parts) {
if (part.text) {
console.log(part.text);
} else if (part.inlineData) {
const imageData = part.inlineData.data;
const buffer = Buffer.from(imageData, "base64");
fs.writeFileSync("gemini-native-image.png", buffer);
console.log("Image saved as gemini-native-image.png");
}
}
}
main();
যাও
package main
import (
"context"
"fmt"
"os"
"google.golang.org/genai"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
imagePath := "/path/to/cat_image.png"
imgData, _ := os.ReadFile(imagePath)
parts := []*genai.Part{
genai.NewPartFromText("Create a picture of my cat eating a nano-banana in a fancy restaurant under the Gemini constellation"),
&genai.Part{
InlineData: &genai.Blob{
MIMEType: "image/png",
Data: imgData,
},
},
}
contents := []*genai.Content{
genai.NewContentFromParts(parts, genai.RoleUser),
}
result, _ := client.Models.GenerateContent(
ctx,
"gemini-2.5-flash-image-preview",
contents,
)
for _, part := range result.Candidates[0].Content.Parts {
if part.Text != "" {
fmt.Println(part.Text)
} else if part.InlineData != nil {
imageBytes := part.InlineData.Data
outputFilename := "gemini_generated_image.png"
_ = os.WriteFile(outputFilename, imageBytes, 0644)
}
}
}
বিশ্রাম
IMG_PATH=/path/to/cat_image.jpeg
if [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then
B64FLAGS="--input"
else
B64FLAGS="-w0"
fi
IMG_BASE64=$(base64 "$B64FLAGS" "$IMG_PATH" 2>&1)
curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d "{
\"contents\": [{
\"parts\":[
{\"text\": \"'Create a picture of my cat eating a nano-banana in a fancy restaurant under the Gemini constellation\"},
{
\"inline_data\": {
\"mime_type\":\"image/jpeg\",
\"data\": \"$IMG_BASE64\"
}
}
]
}]
}" \
| grep -o '"data": "[^"]*"' \
| cut -d'"' -f4 \
| base64 --decode > gemini-edited-image.png

অন্যান্য ইমেজ জেনারেশন মোড
মিথুন প্রম্পট গঠন এবং প্রসঙ্গের উপর ভিত্তি করে অন্যান্য ইমেজ ইন্টারঅ্যাকশন মোড সমর্থন করে, যার মধ্যে রয়েছে:
- টেক্সট টু ইমেজ (গুলি) এবং টেক্সট (ইন্টারলিভড): সম্পর্কিত টেক্সট সহ ইমেজ আউটপুট।
- উদাহরণ প্রম্পট: "পায়েলার জন্য একটি চিত্রিত রেসিপি তৈরি করুন।"
- ছবি(গুলি) এবং টেক্সট টু ইমেজ(গুলি) এবং টেক্সট (ইন্টারলিভড) : নতুন সম্পর্কিত ছবি এবং টেক্সট তৈরি করতে ইনপুট ইমেজ এবং টেক্সট ব্যবহার করে।
- উদাহরণ প্রম্পট: (একটি সজ্জিত ঘরের একটি চিত্র সহ) "আমার জায়গায় অন্য কোন রঙের সোফা কাজ করবে? আপনি কি ছবিটি আপডেট করতে পারেন?"
- মাল্টি-টার্ন ইমেজ এডিটিং (চ্যাট): কথোপকথনে ছবি তৈরি ও সম্পাদনা করতে থাকুন।
- উদাহরণ প্রম্পট: [একটি নীল গাড়ির একটি ছবি আপলোড করুন।] , "এই গাড়িটিকে একটি রূপান্তরযোগ্য করে দিন।", "এখন রঙটি হলুদে পরিবর্তন করুন।"
প্রম্পটিং গাইড এবং কৌশল
জেমিনি 2.5 ফ্ল্যাশ ইমেজ জেনারেশন মাস্টারিং একটি মৌলিক নীতি দিয়ে শুরু হয়:
দৃশ্যটি বর্ণনা করুন, শুধু কীওয়ার্ড তালিকাভুক্ত করবেন না। মডেলের মূল শক্তি হল এর গভীর ভাষা বোঝা। একটি বর্ণনামূলক, বর্ণনামূলক অনুচ্ছেদ প্রায় সবসময় সংযোগ বিচ্ছিন্ন শব্দগুলির তালিকার চেয়ে একটি ভাল, আরও সুসঙ্গত চিত্র তৈরি করবে।
ইমেজ তৈরি করার জন্য অনুরোধ
নিম্নলিখিত কৌশলগুলি আপনাকে ঠিক যে চিত্রগুলি খুঁজছেন তা তৈরি করার জন্য কার্যকর প্রম্পট তৈরি করতে সহায়তা করবে৷
1. ফটোরিয়ালিস্টিক দৃশ্য
বাস্তবসম্মত চিত্রের জন্য, ফটোগ্রাফি পদ ব্যবহার করুন। ফটোরিয়ালিস্টিক ফলাফলের দিকে মডেলটিকে গাইড করতে ক্যামেরার কোণ, লেন্সের ধরন, আলো এবং সূক্ষ্ম বিবরণ উল্লেখ করুন।
টেমপ্লেট
A photorealistic [shot type] of [subject], [action or expression], set in
[environment]. The scene is illuminated by [lighting description], creating
a [mood] atmosphere. Captured with a [camera/lens details], emphasizing
[key textures and details]. The image should be in a [aspect ratio] format.
প্রম্পট
A photorealistic close-up portrait of an elderly Japanese ceramicist with
deep, sun-etched wrinkles and a warm, knowing smile. He is carefully
inspecting a freshly glazed tea bowl. The setting is his rustic,
sun-drenched workshop. The scene is illuminated by soft, golden hour light
streaming through a window, highlighting the fine texture of the clay.
Captured with an 85mm portrait lens, resulting in a soft, blurred background
(bokeh). The overall mood is serene and masterful. Vertical portrait
orientation.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop with pottery wheels and shelves of clay pots in the background. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay and the fabric of his apron. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('photorealistic_example.png')
image.show()

2. শৈলীকৃত চিত্র এবং স্টিকার
স্টিকার, আইকন বা সম্পদ তৈরি করতে, শৈলী সম্পর্কে স্পষ্ট হন এবং একটি স্বচ্ছ ব্যাকগ্রাউন্ডের জন্য অনুরোধ করুন।
টেমপ্লেট
A [style] sticker of a [subject], featuring [key characteristics] and a
[color palette]. The design should have [line style] and [shading style].
The background must be transparent.
প্রম্পট
A kawaii-style sticker of a happy red panda wearing a tiny bamboo hat. It's
munching on a green bamboo leaf. The design features bold, clean outlines,
simple cel-shading, and a vibrant color palette. The background must be white.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="A kawaii-style sticker of a happy red panda wearing a tiny bamboo hat. It's munching on a green bamboo leaf. The design features bold, clean outlines, simple cel-shading, and a vibrant color palette. The background must be white.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('red_panda_sticker.png')
image.show()

3. ছবিতে সঠিক পাঠ্য
মিথুন টেক্সট রেন্ডারিংয়ে পারদর্শী। পাঠ্য, ফন্ট শৈলী (বর্ণনামূলকভাবে), এবং সামগ্রিক নকশা সম্পর্কে পরিষ্কার হন।
টেমপ্লেট
Create a [image type] for [brand/concept] with the text "[text to render]"
in a [font style]. The design should be [style description], with a
[color scheme].
প্রম্পট
Create a modern, minimalist logo for a coffee shop called 'The Daily Grind'.
The text should be in a clean, bold, sans-serif font. The design should
feature a simple, stylized icon of a a coffee bean seamlessly integrated
with the text. The color scheme is black and white.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="Create a modern, minimalist logo for a coffee shop called 'The Daily Grind'. The text should be in a clean, bold, sans-serif font. The design should feature a simple, stylized icon of a a coffee bean seamlessly integrated with the text. The color scheme is black and white.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('logo_example.png')
image.show()

4. পণ্য mockups এবং বাণিজ্যিক ফটোগ্রাফি
ই-কমার্স, বিজ্ঞাপন বা ব্র্যান্ডিংয়ের জন্য পরিষ্কার, পেশাদার পণ্য শট তৈরি করার জন্য উপযুক্ত।
টেমপ্লেট
A high-resolution, studio-lit product photograph of a [product description]
on a [background surface/description]. The lighting is a [lighting setup,
e.g., three-point softbox setup] to [lighting purpose]. The camera angle is
a [angle type] to showcase [specific feature]. Ultra-realistic, with sharp
focus on [key detail]. [Aspect ratio].
প্রম্পট
A high-resolution, studio-lit product photograph of a minimalist ceramic
coffee mug in matte black, presented on a polished concrete surface. The
lighting is a three-point softbox setup designed to create soft, diffused
highlights and eliminate harsh shadows. The camera angle is a slightly
elevated 45-degree shot to showcase its clean lines. Ultra-realistic, with
sharp focus on the steam rising from the coffee. Square image.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="A high-resolution, studio-lit product photograph of a minimalist ceramic coffee mug in matte black, presented on a polished concrete surface. The lighting is a three-point softbox setup designed to create soft, diffused highlights and eliminate harsh shadows. The camera angle is a slightly elevated 45-degree shot to showcase its clean lines. Ultra-realistic, with sharp focus on the steam rising from the coffee. Square image.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('product_mockup.png')
image.show()

5. মিনিমালিস্ট এবং নেতিবাচক স্থান নকশা
ওয়েবসাইট, উপস্থাপনা, বা বিপণন সামগ্রীর জন্য ব্যাকগ্রাউন্ড তৈরি করার জন্য চমৎকার যেখানে পাঠ্য ওভারলেড করা হবে।
টেমপ্লেট
A minimalist composition featuring a single [subject] positioned in the
[bottom-right/top-left/etc.] of the frame. The background is a vast, empty
[color] canvas, creating significant negative space. Soft, subtle lighting.
[Aspect ratio].
প্রম্পট
A minimalist composition featuring a single, delicate red maple leaf
positioned in the bottom-right of the frame. The background is a vast, empty
off-white canvas, creating significant negative space for text. Soft,
diffused lighting from the top left. Square image.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="A minimalist composition featuring a single, delicate red maple leaf positioned in the bottom-right of the frame. The background is a vast, empty off-white canvas, creating significant negative space for text. Soft, diffused lighting from the top left. Square image.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('minimalist_design.png')
image.show()

6. অনুক্রমিক শিল্প (কমিক প্যানেল / স্টোরিবোর্ড)
চাক্ষুষ গল্প বলার জন্য প্যানেল তৈরি করতে চরিত্রের সামঞ্জস্যতা এবং দৃশ্যের বর্ণনার উপর তৈরি করে।
টেমপ্লেট
A single comic book panel in a [art style] style. In the foreground,
[character description and action]. In the background, [setting details].
The panel has a [dialogue/caption box] with the text "[Text]". The lighting
creates a [mood] mood. [Aspect ratio].
প্রম্পট
A single comic book panel in a gritty, noir art style with high-contrast
black and white inks. In the foreground, a detective in a trench coat stands
under a flickering streetlamp, rain soaking his shoulders. In the
background, the neon sign of a desolate bar reflects in a puddle. A caption
box at the top reads "The city was a tough place to keep secrets." The
lighting is harsh, creating a dramatic, somber mood. Landscape.
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents="A single comic book panel in a gritty, noir art style with high-contrast black and white inks. In the foreground, a detective in a trench coat stands under a flickering streetlamp, rain soaking his shoulders. In the background, the neon sign of a desolate bar reflects in a puddle. A caption box at the top reads \"The city was a tough place to keep secrets.\" The lighting is harsh, creating a dramatic, somber mood. Landscape.",
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('comic_panel.png')
image.show()

ইমেজ সম্পাদনা করার জন্য অনুরোধ
এই উদাহরণগুলি সম্পাদনা, রচনা এবং শৈলী স্থানান্তরের জন্য আপনার পাঠ্য প্রম্পটের পাশাপাশি চিত্রগুলি কীভাবে সরবরাহ করতে হয় তা দেখায়।
1. উপাদান যোগ এবং অপসারণ
একটি চিত্র প্রদান করুন এবং আপনার পরিবর্তন বর্ণনা করুন. মডেলটি মূল ছবির শৈলী, আলো এবং দৃষ্টিভঙ্গির সাথে মিলবে।
টেমপ্লেট
Using the provided image of [subject], please [add/remove/modify] [element]
to/from the scene. Ensure the change is [description of how the change should
integrate].
প্রম্পট
"Using the provided image of my cat, please add a small, knitted wizard hat
on its head. Make it look like it's sitting comfortably and matches the soft
lighting of the photo."
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Base image prompt: "A photorealistic picture of a fluffy ginger cat sitting on a wooden floor, looking directly at the camera. Soft, natural light from a window."
image_input = Image.open('/path/to/your/cat_photo.png')
text_input = """Using the provided image of my cat, please add a small, knitted wizard hat on its head. Make it look like it's sitting comfortably and not falling off."""
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[text_input, image_input],
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('cat_with_hat.png')
image.show()
ইনপুট | আউটপুট |
![]() | ![]() |
2. ইনপেইন্টিং (অর্থাৎ মাস্কিং)
কথোপকথনভাবে একটি "মাস্ক" সংজ্ঞায়িত করুন যাতে একটি চিত্রের একটি নির্দিষ্ট অংশ সম্পাদনা করা যায় এবং বাকি অংশটিকে স্পর্শ না করা যায়।
টেমপ্লেট
Using the provided image, change only the [specific element] to [new
element/description]. Keep everything else in the image exactly the same,
preserving the original style, lighting, and composition.
প্রম্পট
"Using the provided image of a living room, change only the blue sofa to be
a vintage, brown leather chesterfield sofa. Keep the rest of the room,
including the pillows on the sofa and the lighting, unchanged."
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Base image prompt: "A wide shot of a modern, well-lit living room with a prominent blue sofa in the center. A coffee table is in front of it and a large window is in the background."
living_room_image = Image.open('/path/to/your/living_room.png')
text_input = """Using the provided image of a living room, change only the blue sofa to be a vintage, brown leather chesterfield sofa. Keep the rest of the room, including the pillows on the sofa and the lighting, unchanged."""
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[living_room_image, text_input],
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('living_room_edited.png')
image.show()
ইনপুট | আউটপুট |
![]() | ![]() |
3. শৈলী স্থানান্তর
একটি চিত্র প্রদান করুন এবং মডেলটিকে একটি ভিন্ন শৈল্পিক শৈলীতে এর বিষয়বস্তু পুনরায় তৈরি করতে বলুন৷
টেমপ্লেট
Transform the provided photograph of [subject] into the artistic style of [artist/art style]. Preserve the original composition but render it with [description of stylistic elements].
প্রম্পট
"Transform the provided photograph of a modern city street at night into the artistic style of Vincent van Gogh's 'Starry Night'. Preserve the original composition of buildings and cars, but render all elements with swirling, impasto brushstrokes and a dramatic palette of deep blues and bright yellows."
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Base image prompt: "A photorealistic, high-resolution photograph of a busy city street in New York at night, with bright neon signs, yellow taxis, and tall skyscrapers."
city_image = Image.open('/path/to/your/city.png')
text_input = """Transform the provided photograph of a modern city street at night into the artistic style of Vincent van Gogh's 'Starry Night'. Preserve the original composition of buildings and cars, but render all elements with swirling, impasto brushstrokes and a dramatic palette of deep blues and bright yellows."""
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[city_image, text_input],
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('city_style_transfer.png')
image.show()
ইনপুট | আউটপুট |
![]() | ![]() |
4. উন্নত রচনা: একাধিক ছবি একত্রিত করা
একটি নতুন, যৌগিক দৃশ্য তৈরি করতে প্রসঙ্গ হিসাবে একাধিক ছবি প্রদান করুন। এটি পণ্য মকআপ বা সৃজনশীল কোলাজের জন্য উপযুক্ত।
টেমপ্লেট
Create a new image by combining the elements from the provided images. Take
the [element from image 1] and place it with/on the [element from image 2].
The final image should be a [description of the final scene].
প্রম্পট
"Create a professional e-commerce fashion photo. Take the blue floral dress
from the first image and let the woman from the second image wear it.
Generate a realistic, full-body shot of the woman wearing the dress, with
the lighting and shadows adjusted to match the outdoor environment."
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Base image prompts:
# 1. Dress: "A professionally shot photo of a blue floral summer dress on a plain white background, ghost mannequin style."
# 2. Model: "Full-body shot of a woman with her hair in a bun, smiling, standing against a neutral grey studio background."
dress_image = Image.open('/path/to/your/dress.png')
model_image = Image.open('/path/to/your/model.png')
text_input = """Create a professional e-commerce fashion photo. Take the blue floral dress from the first image and let the woman from the second image wear it. Generate a realistic, full-body shot of the woman wearing the dress, with the lighting and shadows adjusted to match the outdoor environment."""
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[dress_image, model_image, text_input],
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('fashion_ecommerce_shot.png')
image.show()
ইনপুট 1 | ইনপুট 2 | আউটপুট |
![]() | ![]() | ![]() |
5. উচ্চ বিশ্বস্ততা বিস্তারিত সংরক্ষণ
একটি সম্পাদনার সময় গুরুত্বপূর্ণ বিবরণ (যেমন একটি মুখ বা লোগো) সংরক্ষণ করা হয়েছে তা নিশ্চিত করতে, আপনার সম্পাদনা অনুরোধের সাথে সেগুলিকে বিশদভাবে বর্ণনা করুন৷
টেমপ্লেট
Using the provided images, place [element from image 2] onto [element from
image 1]. Ensure that the features of [element from image 1] remain
completely unchanged. The added element should [description of how the
element should integrate].
প্রম্পট
"Take the first image of the woman with brown hair, blue eyes, and a neutral
expression. Add the logo from the second image onto her black t-shirt.
Ensure the woman's face and features remain completely unchanged. The logo
should look like it's naturally printed on the fabric, following the folds
of the shirt."
পাইথন
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
# Base image prompts:
# 1. Woman: "A professional headshot of a woman with brown hair and blue eyes, wearing a plain black t-shirt, against a neutral studio background."
# 2. Logo: "A simple, modern logo with the letters 'G' and 'A' in a white circle."
woman_image = Image.open('/path/to/your/woman.png')
logo_image = Image.open('/path/to/your/logo.png')
text_input = """Take the first image of the woman with brown hair, blue eyes, and a neutral expression. Add the logo from the second image onto her black t-shirt. Ensure the woman's face and features remain completely unchanged. The logo should look like it's naturally printed on the fabric, following the folds of the shirt."""
# Generate an image from a text prompt
response = client.models.generate_content(
model="gemini-2.5-flash-image-preview",
contents=[woman_image, logo_image, text_input],
)
image_parts = [
part.inline_data.data
for part in response.candidates[0].content.parts
if part.inline_data
]
if image_parts:
image = Image.open(BytesIO(image_parts[0]))
image.save('woman_with_logo.png')
image.show()
ইনপুট 1 | ইনপুট 2 | আউটপুট |
![]() | ![]() | ![]() |
সর্বোত্তম অনুশীলন
আপনার ফলাফলগুলিকে ভাল থেকে দুর্দান্ত করার জন্য, এই পেশাদার কৌশলগুলিকে আপনার কর্মপ্রবাহে অন্তর্ভুক্ত করুন।
- হাইপার-স্পেসিফিক হোন: আপনি যত বেশি বিশদ প্রদান করবেন, তত বেশি নিয়ন্ত্রণ থাকবে। "ফ্যান্টাসি আর্মার" এর পরিবর্তে এটি বর্ণনা করুন: "অলঙ্কৃত এলভেন প্লেট বর্ম, রূপালী পাতার প্যাটার্ন দিয়ে খোদাই করা, একটি উচ্চ কলার এবং ফ্যালকন উইংসের মতো আকৃতির পলড্রন।"
- প্রসঙ্গ এবং উদ্দেশ্য প্রদান করুন: ছবির উদ্দেশ্য ব্যাখ্যা করুন। প্রসঙ্গ সম্পর্কে মডেলের বোঝার চূড়ান্ত আউটপুটকে প্রভাবিত করবে। উদাহরণস্বরূপ, "একটি উচ্চ-সম্পন্ন, ন্যূনতম স্কিনকেয়ার ব্র্যান্ডের জন্য একটি লোগো তৈরি করুন" শুধুমাত্র "লোগো তৈরি করুন" এর চেয়ে ভাল ফলাফল দেবে৷
- পুনরাবৃত্তি করুন এবং পরিমার্জন করুন: প্রথম চেষ্টায় একটি নিখুঁত চিত্র আশা করবেন না। ছোট পরিবর্তন করতে মডেলের কথোপকথন প্রকৃতি ব্যবহার করুন. প্রম্পট সহ অনুসরণ করুন, "এটি দুর্দান্ত, কিন্তু আপনি কি আলোকে একটু উষ্ণ করতে পারেন?" বা "সবকিছু একই রাখুন, কিন্তু চরিত্রের অভিব্যক্তিকে আরও গুরুতর হতে পরিবর্তন করুন।"
- ধাপে ধাপে নির্দেশাবলী ব্যবহার করুন: অনেক উপাদান সহ জটিল দৃশ্যের জন্য, আপনার প্রম্পটকে ধাপে ভাগ করুন। "প্রথমে, ভোরবেলা একটি নির্মল, কুয়াশাচ্ছন্ন বনের পটভূমি তৈরি করুন। তারপর, অগ্রভাগে, একটি শ্যাওলা ঢাকা প্রাচীন পাথরের বেদি যোগ করুন। অবশেষে, বেদীর উপরে একটি একক, উজ্জ্বল তলোয়ার রাখুন।"
- "অর্থাৎ নেতিবাচক প্রম্পট" ব্যবহার করুন: "গাড়ি নেই" বলার পরিবর্তে পছন্দসই দৃশ্যটিকে ইতিবাচকভাবে বর্ণনা করুন: "একটি খালি, নির্জন রাস্তা যেখানে যানবাহনের কোনো চিহ্ন নেই।"
- ক্যামেরা নিয়ন্ত্রণ করুন: রচনা নিয়ন্ত্রণ করতে ফটোগ্রাফিক এবং সিনেমাটিক ভাষা ব্যবহার করুন।
wide-angle shot
,macro shot
,low-angle perspective
মত পদ।
সীমাবদ্ধতা
- সেরা পারফরম্যান্সের জন্য, নিম্নলিখিত ভাষাগুলি ব্যবহার করুন: EN, es-MX, ja-JP, zh-CN, hi-IN৷
- ইমেজ জেনারেশন অডিও বা ভিডিও ইনপুট সমর্থন করে না।
- মডেলটি সর্বদা ব্যবহারকারীর স্পষ্টভাবে জিজ্ঞাসা করা চিত্রের আউটপুটগুলির সঠিক সংখ্যা অনুসরণ করবে না।
- মডেলটি একটি ইনপুট হিসাবে 3টি পর্যন্ত চিত্রের সাথে সেরা কাজ করে৷
- একটি চিত্রের জন্য পাঠ্য তৈরি করার সময়, আপনি যদি প্রথমে পাঠ্য তৈরি করেন এবং তারপর পাঠ্য সহ একটি চিত্রের জন্য জিজ্ঞাসা করেন তবে মিথুন সবচেয়ে ভাল কাজ করে।
- শিশুদের ছবি আপলোড করা বর্তমানে EEA, CH, এবং UK-এ সমর্থিত নয়।
- সমস্ত জেনারেট করা ছবিতে একটি SynthID ওয়াটারমার্ক অন্তর্ভুক্ত।
কখন ইমেজেন ব্যবহার করবেন
Gemini-এর অন্তর্নির্মিত ইমেজ তৈরির ক্ষমতা ব্যবহার করার পাশাপাশি, আপনি Gemini API-এর মাধ্যমে আমাদের বিশেষায়িত ইমেজ জেনারেশন মডেল, Imagen-এ অ্যাক্সেস করতে পারেন।
বৈশিষ্ট্য | চিত্র | মিথুন নেটিভ ইমেজ |
---|---|---|
শক্তি | এখন পর্যন্ত সবচেয়ে সক্ষম ইমেজ জেনারেশন মডেল। ফটোরিয়ালিস্টিক ছবি, তীক্ষ্ণ স্পষ্টতা, উন্নত বানান এবং টাইপোগ্রাফির জন্য প্রস্তাবিত। | ডিফল্ট সুপারিশ. অতুলনীয় নমনীয়তা, প্রাসঙ্গিক বোঝাপড়া এবং সহজ, মাস্ক-মুক্ত সম্পাদনা। মাল্টি-টার্ন কথোপকথন সম্পাদনা করতে অনন্যভাবে সক্ষম। |
প্রাপ্যতা | সাধারণত পাওয়া যায় | পূর্বরূপ (উৎপাদন ব্যবহারের অনুমতি দেওয়া হয়েছে) |
লেটেন্সি | কম কাছাকাছি-রিয়েল-টাইম কর্মক্ষমতা জন্য অপ্টিমাইজ করা. | উচ্চতর। এর উন্নত ক্ষমতার জন্য আরও গণনা প্রয়োজন। |
খরচ | বিশেষ কাজের জন্য সাশ্রয়ী। $0.02/ছবি থেকে $0.12/ছবি | টোকেন-ভিত্তিক মূল্য। ইমেজ আউটপুটের জন্য প্রতি 1 মিলিয়ন টোকেন $30 (ছবির আউটপুট প্রতি ফ্ল্যাট প্রতি 1290 টোকেনে টোকেন করা হয়েছে, 1024x1024px পর্যন্ত) |
সুপারিশকৃত কাজ |
|
|
Imagen 4 আপনার যেতে হবে এমন মডেল হওয়া উচিত যা Imagen দিয়ে ছবি তৈরি করা শুরু করে। উন্নত ব্যবহারের ক্ষেত্রে বা যখন আপনার সর্বোত্তম ছবির গুণমানের প্রয়োজন হয় তখন Imagen 4 Ultra বেছে নিন (মনে রাখবেন যে একবারে শুধুমাত্র একটি ছবি তৈরি করতে পারে)।
এরপর কি
- কুকবুক গাইডে আরও উদাহরণ এবং কোড নমুনা খুঁজুন।
- কিভাবে Gemini API দিয়ে ভিডিও তৈরি করতে হয় তা জানতে Veo গাইডটি দেখুন।
- মিথুন মডেল সম্পর্কে আরও জানতে, মিথুন মডেল দেখুন।