Neodomain AI Content Generator
Generate images and videos using the Neodomain AI platform API.
Setup
Set your access token as an environment variable:
CODEBLOCK0
Or pass it directly to scripts via --token flag.
Image Generation
Get Available Models
CODEBLOCK1
Generate Images
CODEBLOCK2
Parameters
| Parameter | Description | Default |
|---|
| INLINECODE1 | Text description for image generation | Required |
| INLINECODE2 |
Things to exclude from image | Empty |
|
--model | Model name (see models list) |
gemini-3.1-flash-image-preview |
|
--aspect-ratio | Image aspect ratio:
1:1,
16:9,
9:16,
4:3,
3:4 |
1:1 |
|
--num-images | Number of images to generate:
1 or
4 |
1 |
|
--size | Image size:
1K,
2K,
4K |
2K |
|
--guidance-scale | Prompt adherence (1.0-20.0) |
7.5 |
|
--seed | Random seed for reproducibility | Random |
|
--output-format | Output format:
jpeg,
png,
webp |
jpeg |
|
--output-dir | Where to save images |
./output |
Image Generation with Reference Images
Use generate_image_ref.py to generate images with character reference(s). Supports up to 10 reference images per generation:
CODEBLOCK3
| Parameter | Description | Default |
|---|
| INLINECODE32 | Reference image URL(s) - can specify multiple (up to 10) | - |
Video Generation
Get Available Models
CODEBLOCK4
Generate Videos
Text-to-Video
CODEBLOCK5
Image-to-Video
CODEBLOCK6
Motion Control (Image + Video Reference)
CODEBLOCK7
Parameters
| Parameter | Description | Default |
|---|
| INLINECODE33 | Text description for video | Required |
| INLINECODE34 |
Model name:
veo3,
hailuo02,
doubao |
veo3 |
|
--generation-type | Type:
TEXT_TO_VIDEO,
IMAGE_TO_VIDEO,
REFERENCE_TO_VIDEO |
TEXT_TO_VIDEO |
|
--first-frame | First frame image URL (for IMAGE
TOVIDEO) | - |
|
--last-frame | Last frame image URL (optional) | - |
|
--image-urls | Reference images (comma-separated, for REFERENCE
TOVIDEO) | - |
|
--aspect-ratio | Video aspect:
16:9,
9:16,
1:1 |
16:9 |
|
--resolution | Resolution:
720p,
768p,
1080p |
720p |
|
--duration | Duration:
4s,
5s,
6s,
8s,
10s,
16s |
8s |
|
--fps | Frame rate |
24 |
|
--seed | Random seed | Random |
|
--generate-audio | Generate audio (true/false) |
false |
|
--enhance-prompt | Enhance prompt (true/false) |
false |
|
--output-dir | Where to save output |
./output |
Authentication
重要: 每次 token 过期或首次使用时,动态询问用户登录账号(手机号/邮箱),不要硬编码保存。
If you need to obtain an access token:
CODEBLOCK8
The login script will output an access token that you can store in NEODOMAIN_ACCESS_TOKEN.
Workflow
- 1. Authenticate (first time only): Get your access token
- Get models: Check available models for your needs
- Generate: Create content with appropriate parameters
- Wait: Scripts automatically poll for results
- Download: Images/videos saved to output directory
Output
- - Images:
*.jpg, *.png, or *.webp files - Videos:
*.mp4 files with thumbnail - INLINECODE79 with generation details
Neodomain AI 内容生成器
使用 Neodomain AI 平台 API 生成图像和视频。
设置
将您的访问令牌设置为环境变量:
bash
export NEODOMAINACCESSTOKEN=youraccesstoken_here
或者通过 --token 标志直接传递给脚本。
图像生成
获取可用模型
bash
python3 {baseDir}/scripts/imagemodels.py --token $NEODOMAINACCESS_TOKEN
生成图像
bash
基础文本转图像
python3 {baseDir}/scripts/generate
image.py --prompt 日落时分的未来城市 --token $NEODOMAINACCESS_TOKEN
带选项
python3 {baseDir}/scripts/generate_image.py \
--prompt 美丽的山景 \
--negative-prompt 模糊,低质量 \
--model doubao-seedream-4-0 \
--aspect-ratio 16:9 \
--num-images 4 \
--size 2K \
--output-dir ./output/images \
--token $NEODOMAIN
ACCESSTOKEN
参数
| 参数 | 描述 | 默认值 |
|---|
| --prompt | 图像生成的文本描述 | 必填 |
| --negative-prompt |
要从图像中排除的内容 | 空 |
| --model | 模型名称(参见模型列表) | gemini-3.1-flash-image-preview |
| --aspect-ratio | 图像宽高比:1:1,16:9,9:16,4:3,3:4 | 1:1 |
| --num-images | 生成的图像数量:1 或 4 | 1 |
| --size | 图像尺寸:1K,2K,4K | 2K |
| --guidance-scale | 提示遵循度(1.0-20.0) | 7.5 |
| --seed | 用于可复现性的随机种子 | 随机 |
| --output-format | 输出格式:jpeg,png,webp | jpeg |
| --output-dir | 图像保存位置 | ./output |
使用参考图像生成图像
使用 generateimageref.py 生成带角色参考的图像。每次生成最多支持 10 张参考图像:
bash
单张参考图像
python3 {baseDir}/scripts/generate
imageref.py \
--prompt 一位在森林中行走的女性 \
--reference-image https://example.com/character1.jpg \
--model doubao-seedream-5-0-260128 \
--aspect-ratio 16:9 \
--token $NEODOMAIN
ACCESSTOKEN
多张参考图像(最多 10 张)
python3 {baseDir}/scripts/generate
imageref.py \
--prompt 两个人的对话 \
--reference-image https://example.com/character1.jpg \
--reference-image https://example.com/character2.jpg \
--reference-image https://example.com/character3.jpg \
--model doubao-seedream-5-0-260128 \
--aspect-ratio 16:9 \
--token $NEODOMAIN
ACCESSTOKEN
| 参数 | 描述 | 默认值 |
|---|
| --reference-image | 参考图像 URL - 可指定多个(最多 10 个) | - |
视频生成
获取可用模型
bash
python3 {baseDir}/scripts/videomodels.py --token $NEODOMAINACCESS_TOKEN
生成视频
文本转视频
bash
python3 {baseDir}/scripts/generate_video.py \
--prompt 黎明时分的宁静湖泊,雾气从水面升起 \
--model veo3 \
--generation-type TEXTTOVIDEO \
--aspect-ratio 16:9 \
--resolution 720p \
--duration 8s \
--token $NEODOMAINACCESSTOKEN
图像转视频
bash
python3 {baseDir}/scripts/generate_video.py \
--prompt 相机缓慢地扫过整个景观 \
--model veo3 \
--generation-type IMAGETOVIDEO \
--first-frame https://example.com/image.jpg \
--aspect-ratio 16:9 \
--resolution 720p \
--duration 8s \
--token $NEODOMAINACCESSTOKEN
运动控制(图像 + 视频参考)
bash
python3 {baseDir}/scripts/motion_control.py \
--image https://example.com/ref_image.jpg \
--video https://example.com/ref_video.mp4 \
--prompt 让角色跳舞 \
--mode pro \
--duration 5000 \
--token $NEODOMAINACCESSTOKEN
参数
| 参数 | 描述 | 默认值 |
|---|
| --prompt | 视频的文本描述 | 必填 |
| --model |
模型名称:veo3,hailuo02,doubao | veo3 |
| --generation-type | 类型:TEXT
TOVIDEO,IMAGE
TOVIDEO,REFERENCE
TOVIDEO | TEXT
TOVIDEO |
| --first-frame | 首帧图像 URL(用于 IMAGE
TOVIDEO) | - |
| --last-frame | 尾帧图像 URL(可选) | - |
| --image-urls | 参考图像(逗号分隔,用于 REFERENCE
TOVIDEO) | - |
| --aspect-ratio | 视频宽高比:16:9,9:16,1:1 | 16:9 |
| --resolution | 分辨率:720p,768p,1080p | 720p |
| --duration | 时长:4s,5s,6s,8s,10s,16s | 8s |
| --fps | 帧率 | 24 |
| --seed | 随机种子 | 随机 |
| --generate-audio | 生成音频(true/false) | false |
| --enhance-prompt | 增强提示(true/false) | false |
| --output-dir | 输出保存位置 | ./output |
认证
重要: 每次 token 过期或首次使用时,动态询问用户登录账号(手机号/邮箱),不要硬编码保存。
如果您需要获取访问令牌:
bash
1. 发送验证码 (询问用户手机号或邮箱)
python3 {baseDir}/scripts/login.py --send-code --contact 用户手机号或邮箱
2. 用户提供验证码后,登录获取 token
python3 {baseDir}/scripts/login.py --login --contact 用户手机号或邮箱 --code 验证码
登录脚本将输出一个访问令牌,您可以将其存储在 NEODOMAINACCESSTOKEN 中。
工作流程
- 1. 认证(仅首次):获取您的访问令牌
- 获取模型:检查可用的模型以满足您的需求
- 生成:使用适当的参数创建内容
- 等待:脚本自动轮询结果
- 下载:图像/视频保存到输出目录
输出
- - 图像:.jpg,.png 或 .webp 文件
- 视频:带缩略图的 .mp4 文件
- 包含生成详情的 metadata.json