editing_type that says
how to use the image. You can change either one while the edit runs.
Pick an edit type
First decide what you want to change. Then choose an image that shows that look, garment, character, or place.style_transfer is the default if you omit editing_type.
Choose the reference image
Style transfer
Use an image whose colors and rendering style you want to apply. The JS SDK example includes clay animation, stained glass, woodblock print, and blueprint images.Virtual try-on
Use an image that clearly shows the item you want to try on. The JS SDK example includes a sequined jacket, dinosaur costume, sunflower hat, and rainbow wig. Keep the matching part of your body in the camera frame.Subject replacement
Use an image of the person or character whose appearance you want. The JS SDK example includes a marble statue, an astronaut, and a garden gnome. Keep the person on camera in frame.Background replacement
Use an image of the place you want behind the person on camera. The JS SDK example includes a Mars landscape, a TV news studio, and a Tokyo alley.Frame your camera
Keep the part of the person you want to edit in the camera frame.- Light the person evenly from the front.
- Keep the camera track flowing. A stalled camera stalls the edit.
Upload or URL
Pass the image as an upload withreference_image, or as a public http(s) URL with
reference_image_url. Both take PNG, JPG, or WebP, under 10 MB.
The model does not apply an uploaded image’s EXIF orientation. Rotate a phone photo before you
upload it. For a URL, the model fetches the image when the edit starts or you send a switch.
Switch mid-edit
switch_reference changes the image, the edit type, or both, while the edit runs. What you omit
stays as it is:
The picture changes after the switch is sent. If the switch fails, the previous look stays. A
command_error for switch_reference can arrive after the reply. Send each switch once. Do not
resend it when nothing seems to change.
Handle content refusals
Vidu S2-Editing is moderated. An edit stopped for its content ends withend_reason: "content_policy", and last_error.reason says why. Show that reason to the user
rather than retrying with the same image.
See also
- Schema: every command, parameter, and message.
- Tutorial: build a browser app from start to finish.
- Content moderation: how Reactor moderates the models it serves.