Image Generator
This skill allows users to generate high-quality images based on text descriptions using an external image generation API(Gitee AI).
Usage
Ensure you have installed the required dependencies (pip install openai). Use the bundled script to generate images.
Qwen-Image (Default)
CODEBLOCK0
Kolors
CODEBLOCK1
GLM-Image
CODEBLOCK2
HunyuanDiT-v1.2-Diffusers-Distilled
CODEBLOCK3
FLUX.2-dev
CODEBLOCK4
Options
Sizes:
- -
256x256 - Small square format - INLINECODE2 - Square format
- INLINECODE3 (default) - Square format
- INLINECODE4 - 16:9 landscape
- INLINECODE5 - 9:16 portrait
- INLINECODE6 - 4:3 format
- INLINECODE7 - 3:4 portrait
- INLINECODE8 - 16:10 landscape
- INLINECODE9 - 10:16 portrait
- INLINECODE10 - High-resolution square format
Additional flags:
- -
--model - Specify the model to use. Options include Qwen-Image (default), Kolors, GLM-Image, FLUX.2-dev, HunyuanDiT-v1.2-Diffusers-Distilled. - INLINECODE17 - Specify what elements users want to avoid in the generated image(default: "低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感,人脸无细节,过度光滑,画面具有AI感。构图混乱。文字模糊,扭曲。").
- INLINECODE18 - Specify the size of the generated image. Options include
256x256, 512x512, 1024x1024 (default), 1024x576, 576x1024, 1024x768, 768x1024, 1024x640, 640x1024, 2048x2048. - INLINECODE29 - Float value to control how closely the model adheres to the prompt (default depends on model).
- INLINECODE30 - Integer for denoise steps (default depends on model). Higher values typically increase quality but take longer.
Model Specific Defaults:
- -
Kolors: steps 25 (range 20-30), scale 7.5 (range 0-100) - INLINECODE32 : steps 30 (range 4-50)
- INLINECODE33 : steps 30 (range 10-50), scale 1.5 (range 0-10)
- INLINECODE34 : steps 25 (range 25-50), scale 5 (range 0-20)
- INLINECODE35 : steps 20 (range 10-50), scale 7.5 (range 0-100)
Workflow
- 1. Execute the performimagegen.py script with the parameters from the user.
- Parse the script output and find the line starting with
IMAGE_URL:. - Extract the image URL from that line (format:
IMAGE_URL: https://...). - Display the image to the user using markdown syntax:
🖼️[Generated Image](URL).
Notes
- - You should not only return the image URL but also describe the image based on the user's prompt, and claim the hyperparameters used for generation.
- You should always wait for the script to finish executing, don't shut it down prematurely.
- The Lanaguage of your answer should be consistent with the user's question.
- By default, return image URL directly without downloading.
- If GITEEAIAPIKEY is none, the user must provide --api-key argument.
- The script prints
IMAGE_URL: in the output - extract this URL and display it using markdown image syntax: 🖼️[Generated image](URL). - Always look for the line starting with
IMAGE_URL: in the script output and render the image for the user. - You should honestly repeat the description of the image from user without any additional imaginations.
- Handling User Feedback on Quality: If the user states the image quality is low or lacks details, you should retry generating with a higher
--num-inference-steps (e.g. 25 → 30). - Handling User Feedback on Prompt Adherence: If the user states the image doesn't follow the prompt closely enough or ignores details, increase the
--guidance-scale parameter (e.g. 7.5 → 15). If they say it's oversaturated or distorted, decrease it.
图像生成器
该技能允许用户通过外部图像生成API(Gitee AI)基于文本描述生成高质量图像。
使用方法
确保已安装所需依赖(pip install openai)。使用捆绑脚本生成图像。
Qwen-Image(默认)
bash
python {baseDir}/scripts/performimagegen.py --prompt 你的图像描述 --model Qwen-Image --size 1024x1024 --negative-prompt 需避免的元素 --num-inference-steps 30 --api-key YOURAPIKEY
Kolors
bash
python {baseDir}/scripts/performimagegen.py --prompt 你的图像描述 --model Kolors --size 1024x1024 --num-inference-steps 25 --guidance-scale 7.5 --api-key YOURAPIKEY
GLM-Image
bash
python {baseDir}/scripts/performimagegen.py --prompt 你的图像描述 --model GLM-Image --size 1024x1024 --negative-prompt 需避免的元素 --num-inference-steps 30 --guidance-scale 1.5 --api-key YOURAPIKEY
HunyuanDiT-v1.2-Diffusers-Distilled
bash
python {baseDir}/scripts/performimagegen.py --prompt 你的图像描述 --model HunyuanDiT-v1.2-Diffusers-Distilled --size 1024x1024 --negative-prompt 需避免的元素 --num-inference-steps 25 --guidance-scale 5.0 --api-key YOURAPIKEY
FLUX.2-dev
bash
python {baseDir}/scripts/performimagegen.py --prompt 你的图像描述 --model FLUX.2-dev --size 1024x1024 --negative-prompt 需避免的元素 --num-inference-steps 20 --guidance-scale 7.5 --api-key YOURAPIKEY
选项
尺寸:
- - 256x256 - 小正方形格式
- 512x512 - 正方形格式
- 1024x1024(默认) - 正方形格式
- 1024x576 - 16:9 横向
- 576x1024 - 9:16 纵向
- 1024x768 - 4:3 格式
- 768x1024 - 3:4 纵向
- 1024x640 - 16:10 横向
- 640x1024 - 10:16 纵向
- 2048x2048 - 高分辨率正方形格式
附加参数:
- - --model - 指定使用的模型。选项包括 Qwen-Image(默认)、Kolors、GLM-Image、FLUX.2-dev、HunyuanDiT-v1.2-Diffusers-Distilled。
- --negative-prompt - 指定用户希望在生成图像中避免的元素(默认:低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感,人脸无细节,过度光滑,画面具有AI感。构图混乱。文字模糊,扭曲。)。
- --size - 指定生成图像的尺寸。选项包括 256x256、512x512、1024x1024(默认)、1024x576、576x1024、1024x768、768x1024、1024x640、640x1024、2048x2048。
- --guidance-scale - 浮点值,控制模型遵循提示的紧密程度(默认值取决于模型)。
- --num-inference-steps - 去噪步数的整数(默认值取决于模型)。较高的值通常提高质量但耗时更长。
模型特定默认值:
- - Kolors:步数 25(范围 20-30),引导尺度 7.5(范围 0-100)
- Qwen-Image:步数 30(范围 4-50)
- GLM-Image:步数 30(范围 10-50),引导尺度 1.5(范围 0-10)
- HunyuanDiT-v1.2-Diffusers-Distilled:步数 25(范围 25-50),引导尺度 5(范围 0-20)
- FLUX.2-dev:步数 20(范围 10-50),引导尺度 7.5(范围 0-100)
工作流程
- 1. 使用用户提供的参数执行 performimagegen.py 脚本。
- 解析脚本输出,找到以 IMAGEURL: 开头的行。
- 从该行提取图像URL(格式:IMAGEURL: https://...)。
- 使用Markdown语法向用户显示图像:🖼️生成的图像。
注意事项
- - 不仅应返回图像URL,还应基于用户提示描述图像,并说明生成时使用的超参数。
- 应始终等待脚本执行完成,不要提前终止。
- 回答的语言应与用户提问的语言一致。
- 默认情况下,直接返回图像URL而不下载。
- 如果 GITEEAIAPIKEY 为空,用户必须提供 --api-key 参数。
- 脚本会在输出中打印 IMAGEURL: - 提取此URL并使用Markdown图像语法显示:🖼️生成的图像。
- 始终在脚本输出中查找以 IMAGE_URL: 开头的行,并为用户渲染图像。
- 应如实重复用户对图像的描述,不添加任何额外想象。
- 处理用户对质量的反馈:如果用户表示图像质量低或缺乏细节,应使用更高的 --num-inference-steps 重试生成(例如 25 → 30)。
- 处理用户对提示遵循度的反馈:如果用户表示图像未能紧密遵循提示或忽略了细节,增加 --guidance-scale 参数(例如 7.5 → 15)。如果用户表示图像过饱和或失真,则减小该参数。