imagegen
वह command जिससे एजेंट किसी prompt से, वैकल्पिक reference images के साथ, images बनाते हैं और उन्हें local files के रूप में सेव करते हैं।
imagegen एक text prompt को एक या ज़्यादा image files में बदलता है। आप reference images (local files या web addresses) जोड़ सकते हैं, जिनके आधार पर model काम करे। यह images का इंतज़ार करता है, उन्हें सेव करता है और उनके paths दिखाता है।
यह कहाँ चलता है
यही command cloud टीम और Mac टीम, दोनों के एजेंट्स के लिए उपलब्ध है। Sign-in और एजेंट attribution एजेंट के environment से आते हैं, इसलिए कुछ सेट नहीं करना पड़ता। Command को curl, jq और base64 चाहिए, जो एजेंट का environment देता है। दोनों तरह की टीमों के लिए देखें चुनें कि आपके एजेंट कहाँ चलें।
Synopsis
imagegen [options] PROMPT
imagegen [options] --prompt-file PATH
imagegen --helpPrompt वे सभी शब्द हैं जो option नहीं हैं, spaces से जोड़े हुए, इसलिए quotes लगाना वैकल्पिक है। -- के बाद का सब कुछ prompt माना जाता है, - से शुरू होने वाले शब्द भी।
Options
Value लेने वाला हर option --option=value रूप भी स्वीकार करता है।
| Option | Value | Default | मतलब |
|---|---|---|---|
-i, --image |
एक path या http(s):// address |
None | एक reference image जोड़ता है। कई images के लिए इसे दोहराएँ। Local files PNG, JPEG, WebP या GIF होनी चाहिए (extension से: .png, .jpg, .jpeg, .webp, .gif) और खाली नहीं होनी चाहिए। |
-n, --count |
1 से 10 तक की पूर्ण संख्या | 1 |
कितनी images बनानी हैं। |
-o, --output |
एक path | $TMPDIR के अंदर एक नया folder |
एक image के साथ: ठीक वह file जो लिखनी है। कई के साथ: वह folder जिसमें उन्हें लिखना है। |
--model |
Model id, बिना spaces | Service का default | इस्तेमाल होने वाला image model। |
--size |
कोई size या aspect shorthand, बिना spaces | auto |
Output size। Model को जैसा दिया वैसा भेजा जाता है। |
--quality |
auto, low, medium, high |
auto |
Output quality। |
--format |
png, jpeg, webp |
png |
कौन-सा file format माँगना है। |
--background |
auto, transparent, opaque |
auto |
Background। transparent के लिए png या webp चाहिए। |
--prompt-file |
UTF-8 text file का path | None | Prompt file से पढ़ता है। या तो यह इस्तेमाल करें या line पर prompt, दोनों नहीं। |
-h, --help |
— | — | Help दिखाता है। |
Files कहाँ जाती हैं
--output |
--count |
नतीजा |
|---|---|---|
| नहीं दिया | कोई भी | एक नया folder $TMPDIR/imagegen.XXXXXX/ (या TMPDIR सेट न हो तो /tmp के अंदर), जिसमें files image-1.png, image-2.png, … |
| एक file path | 1 |
ठीक वही file। न मौजूद parent folders बना दिए जाते हैं। |
| एक folder path | 1 से ज़्यादा |
उस folder के अंदर image-1.<ext>, image-2.<ext>, …, folder ज़रूरत हो तो बना दिया जाता है। |
Extension service के लौटाए format (png, jpeg, webp, gif या svg) के हिसाब से होता है, वरना --format के हिसाब से। imagegen कभी overwrite नहीं करता: अगर target file पहले से मौजूद है, तो यह error के साथ रुक जाता है। --output के बिना प्रोजेक्ट folder में कुछ नहीं लिखा जाता; जो files रखनी हैं, उन्हें खुद प्रोजेक्ट में कॉपी करें।
Output
सफल होने पर stdout पर हर line में एक absolute file path होता है और कुछ नहीं, ताकि इसे pipe किया जा सके:
/tmp/imagegen.Ab12Cd/image-1.png
/tmp/imagegen.Ab12Cd/image-2.pngProgress stderr पर जाता है: request से पहले Generating 2 images with <model>... और अंत में Generated 2 images.।
Exit codes और errors
हर error stderr पर छपता है और Error: से शुरू होता है। Usage errors के साथ Usage: imagegen [options] PROMPT और Run imagegen --help for details. भी आते हैं।
| Exit code | मतलब |
|---|---|
0 |
Images सेव हो गईं; उनके paths stdout पर हैं। |
1 |
Request service तक पहुँची और fail हुई, या नतीजा सेव नहीं हो सका। |
2 |
Command line या inputs गलत हैं, या environment में कुछ कमी है। कुछ नहीं बना। |
| Message | Exit | क्या करें |
|---|---|---|
a prompt is required. / the prompt cannot be empty. |
2 | Prompt या --prompt-file दें। |
pass either PROMPT or --prompt-file, not both. |
2 | इनमें से एक रखें। |
prompt file is not readable: PATH |
2 | Path जाँचें। |
--count must be an integer from 1 to 10. |
2 | 1–10 इस्तेमाल करें। |
--quality must be auto, low, medium, or high. |
2 | इनमें से कोई value इस्तेमाल करें। |
--format must be png, jpeg, or webp. |
2 | इनमें से कोई value इस्तेमाल करें। |
--background must be auto, transparent, or opaque. |
2 | इनमें से कोई value इस्तेमाल करें। |
transparent backgrounds require png or webp output. |
2 | --format png या --format webp जोड़ें। |
--model must be a nonempty model id without whitespace. / --size must be a nonempty value without whitespace. |
2 | Value ठीक करें। |
reference image is not readable: PATH / reference image is empty: PATH |
2 | File जाँचें। |
unsupported reference image type: PATH |
2 | .png, .jpg, .jpeg, .webp या .gif file इस्तेमाल करें। |
prompt and reference images exceed the 20 MiB request limit. |
2 | कम या छोटी reference images इस्तेमाल करें, या उन्हें web addresses के रूप में दें। |
output already exists: PATH |
2 | कोई और --output चुनें, या मौजूदा file हटाएँ। |
multi-image output must be a directory: PATH |
2 | --count 1 से ज़्यादा हो तो --output एक folder होना चाहिए। |
unknown option: … |
2 | ऊपर की table से spelling मिलाएँ। |
the Agent runtime is missing the required '…' command., या ऐसा message कि Agent runtime ने command की ज़रूरी चीज़ नहीं दी |
2 / 1 | Command AirBuild एजेंट के environment के बाहर चलाई जा रही है। इसे किसी एजेंट से चलाएँ। |
could not reach the Airbuild image service. |
1 | Network की समस्या। फिर कोशिश करें। |
Service का अपना message, या the Airbuild image service returned HTTP <status>. |
1 | Message पढ़ें; यह बताता है कि service ने क्या ठुकराया, जैसे prompt या कोई value। |
Airbuild returned no generated images. / requested N image(s), but Airbuild returned M. |
1 | फिर कोशिश करें, या prompt बदलें। |
could not download generated image N. / generated image N is empty. / Airbuild returned invalid base64 for image N. / Airbuild returned no usable data for image N. |
1 | फिर कोशिश करें। |
उदाहरण
# One image, saved to a new folder under $TMPDIR
imagegen "A friendly robot app icon, flat vector style"
# Polish a sketch, saved to an exact file
imagegen --image sketch.png --output final.png "Polish this sketch"
# Three variants into one folder
imagegen --count 3 --output variants "Three calm onboarding illustrations"
# A transparent PNG with a long prompt kept in a file
imagegen --background transparent --format png --prompt-file prompt.txt -o Assets/badge.png