Grok으로 동영상 만들기
텍스트, 소스 이미지 또는 이미지 및 사전 설정 음성 참조로 비동기 Grok Imagine Video 1.5 작업을 만듭니다.
request_id를 반환하므로 비동기 워크플로의 첫 단계로 처리하세요.
항상 model: grok-imagine-video-1.5을 명시적으로 전송하세요. 여기에서 설명하는 1.5 요청 형식에는 model 및 prompt가 필요합니다.
입력 모드 선택
data:image/png;base64,<BASE64_IMAGE_DATA>을 사용하세요. 각 reference_images 항목은 동일한 url 필드를 사용합니다. 참조 오디오 항목은 voice_id 사전 설정을 사용하며, 예를 들어 eve과 같습니다. 프롬프트에서 <IMAGE_0> 및 <AUDIO_0> 같은 태그로 해당 참조를 식별할 수 있습니다.
작은 요청으로 시작하기
model: grok-imagine-video-1.5사용- 첫 요청에서는
duration을1로,resolution을480p로 유지하세요. - 장면과 움직임이 명확하도록
prompt을 명시적으로 지정하세요. - 참조 이미지와 음성을 결합하기 전에 입력 모드를 한 번에 하나씩 추가하세요.
길이 및 해상도
duration, resolution 및 aspect_ratio를 명시적으로 설정하세요.
작업 흐름
작업 만들기
request_id를 저장하세요.완료 상태 폴링
status가 done, failed 또는 expired 중 하나가 될 때까지 확인하세요. 작업 메타데이터가 준비되는 동안 초기 응답에는 에코된 request_id만 포함될 수 있습니다.출력 유지
video.url를 자체 스토리지에 복사하세요.인증
Use your CometAPI API key as the bearer value.
본문
The Grok video model ID. Send this field explicitly so the request uses Grok Imagine Video 1.5.
grok-imagine-video-1.5 "grok-imagine-video-1.5"
A description of the scene, motion, and audio. Reference-to-video prompts can identify inputs with tags such as <IMAGE_0> and <AUDIO_0>.
1"A paper boat glides across a quiet pond at sunrise."
The output duration in seconds. Use an integer from 1 through 15.
1 <= x <= 15The output aspect ratio. Text-to-video uses 16:9 when omitted. Image-to-video uses the source image's aspect ratio when omitted.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 "16:9"
The output resolution. Reference-to-video requests support 480p and 720p; text-to-video and image-to-video also support 1080p.
480p, 720p, 1080p The source image for image-to-video. Do not combine this field with reference_images or reference_audios.
Visual references for reference-to-video. Each item accepts a public image URL or image data URI. Do not combine this field with image.
1 - 7 elementsPreset voice references for reference-to-video. Do not combine this field with image.
1 - 3 elements응답
Request accepted.
The deferred request ID used to poll GET /grok/v1/videos/{request_id}.