Reference-to-image / video generation using a denoising model

The 'in-sequence conditioning' approach using a denoising model with self-attention and synthetic training data effectively generates high-fidelity images and videos from textual descriptions, addressing visual consistency and computational overhead challenges.

WO2026246464A1PCT designated stage Publication Date: 2026-11-26GDM HOLDING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/US2026/028867
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-23
Filing Date
2026-05-19
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing machine learning models struggle to generate high-fidelity images and videos from textual descriptions while maintaining visual consistency and incorporating multiple objects or concepts without introducing computational overhead or visual artifacts.

Method used

An 'in-sequence conditioning' approach using a denoising model processes a continuous token sequence comprising visual and textual data to generate output tokens, employing a self-attention mechanism and incorporating multiple reference modalities like images, audio, and video, with training techniques that leverage synthetic data and raw video bootstrapping.

Benefits of technology

Enables versatile and coherent multi-object composition with improved temporal consistency and reduced computational overhead, overcoming data scarcity and visual artifact issues in existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US2026028867_26112026_PF_FP_ABST
    Figure US2026028867_26112026_PF_FP_ABST
Patent Text Reader

Abstract

There is provided a method for generating output visual tokens representing a target image or a target video. The method comprises obtaining an input token sequence comprising a series of successive token sub-sequences comprising, respectively, a first set of tokens, a second set of tokens, and at least one third set of tokens. The first set comprises input visual tokens, the second set comprises tokens representing a description of the target image / video, and the third set comprises image tokens representing a first input content image depicting an object. The method further comprises processing, using a denoising model, the input token sequence to generate output visual tokens representing the target image / video. The denoising model comprises a self-attention layer implementing a self-attention mechanism. Processing the input token sequence comprises applying self-attention over the series of successive token sub-sequences of the input token sequence.
Need to check novelty before this filing date? Find Prior Art

Description

ATTORNEY DOCKET NO. 45288-0665WO1REFERENCE-TO-IMAGE / VIDEO GENERATION USING A DENOISING MODEL CROSS-REFERENCE TO RELATED APPLICATION

[0001] This application claims priority to Greek Application No. 20250100389, filed on May 23, 2025. The disclosure of the prior application is considered part of and is incorporated by reference in the disclosure of this application.BACKGROUND

[0002] This specification relates to processing data using machine learning models.

[0003] Machine learning models receive an input and generate an output, e.g., a predicted output, based on the received input. Some machine learning models are parametric models and generate the output based on the received input and on values of the parameters of the model.

[0004] Some machine learning models are deep models that employ multiple layers of models to generate an output for a received input. For example, a deep neural network is a deep machine learning model that includes an output layer and one or more hidden layers that each apply a non-linear transformation to a received input to generate an output.SUMMARY

[0005] This specification describes systems and methods implemented as computer programs on one or more computers in one or more locations that relate to the generation of images or videos from reference data such as textual descriptions and reference images. Generally, the generated images and videos visually represent the reference data, e.g. visually represent the textual description and depict one or more objects that are depicted in the reference image(s). In broad terms, the proposed techniques involve an ‘In sequence conditioning’7approach in which a denoising model processes a continuous token sequence comprising input visual tokens and tokens representing the reference data to generate output visual tokens that represent the output images / videos. This specification also describes the training of the denoising model, and a user interface for the image / video generation system.

[0006] According to a first aspect of this specification, there is disclosed a computer-implemented method for generating a plurality of output visual tokens representing a target image or a target video. The output visual tokens may be output image tokens, for example, data representing images or patches of the target image, or output video tokens, for example, data representing frames or patches of frames of the target video.

[0007] The method comprises obtaining an input token sequence comprising a series of successive token sub-sequences. The token sub-sequences comprise, respectively, a first set ofATTORNEY DOCKET NO. 45288-0665WO1tokens, a second set of tokens, and at least one third set of tokens. The first set of tokens may precede the second set of tokens in the input token sequence, and the second set of tokens may precede the third set of tokens in the input token sequence, though other orders of the token sub-sequences may be utilized.

[0008] The first set of tokens comprises a plurality of input visual tokens. Similar to the output visual tokens, the input visual tokens are input image tokens when the method generates a target image, and input video tokens when the method generates a target video. The input visual tokens may represent an input noise image or an input noise video, which can comprise a noisy image or video sampled from a predefined noise distribution, such as a Gaussian noise distribution having a zero mean and a unit variance.

[0009] The second set of tokens comprises a plurality’ of tokens representing a description of the target image or target video. The plurality of tokens representing the description may be text tokens from a vocabulary, such as tokens representing letters selected from a natural language alphabet, words, or parts of words. Alternatively, the plurality of tokens representing the description of the target image or target video may be an embedding of this description generated by a trained language model, such as a text-to-text model or an image-to-text model.

[0010] The third set of tokens comprises a plurality' of image tokens representing a first input content image depicting an object. The input token sequence may comprise, in addition to the first and second set of tokens, a plurality of third sets of tokens, representing, respectively, the first input content image and one or more further input content images. Each input content image depicts a respective object, meaning each input content image may depict a different object, or some or all of the input content images may depict the same object. Thus, when one or more further third sets of tokens are present in the input token sequence, each further third set of tokens comprises a respective plurality’ of image tokens representing a respective further input content image depicting a respective object.

[0011] The tokens of the second set of tokens and the tokens of the third set(s) of tokens collectively represent conditioning data (or “reference” or “instruction” data). This means that the target image or target video is generated according to the conditioning data such that it visually represents the description and incorporates the object depicted by the first input content image (as well as the respective further objects depicted by the further input content images when present). While the target image or video depicts the object(s), it normally does not explicitly include the input content image(s) in its entirety' and may depict the object(s) in different poses or orientations compared to the input content image(s). For example, the input content image(s) may not in its entirety be incorporated in part of the target image or as a frameATTORNEY DOCKET NO. 45288-0665WO1of the target video. In video generation, the target video may depict the object(s) in only a subset of all frames (i.e. although possible, it is not necessary that the target video depicts the object(s) in even- frame of the target video), and multiple objects do not necessarily need to be incorporated into the same frame.

[0012] The method further comprises processing, using a denoising model, the input token sequence to generate the plurality of output visual tokens representing the target image or the target video. The denoising model is a trained machine learning model that has been trained to process the input token sequence to generate the plurality of output visual tokens by using a noise removal process (e.g. by estimating noise in the input token sequence and removing the estimated noise from the input token sequence to denoise / update the input token sequence). More specifically, the denoising model may be configured to iteratively process the input token sequence comprising the input visual tokens, and optionally one or more tokens representing a denoising time step, to generate output visual tokens for denoising the input visual tokens. To this end, the denoising model may, for example, predict estimated de-noised tokens, or predict an estimate of noise that can be subtracted to obtain denoised tokens, or predict a so-called score (a gradient of the log likelihood of the current output visual tokens).

[0013] The denoising model may be implemented using any suitable architecture. For example, the denoising model may be or may comprise a diffusion model (also referred to as diffusion neural network and / or denoising neural network) and / or an optical flow / consistency model. A diffusion model may operate in a latent space, iteratively applying a denoising network to an input Gaussian noise during sampling to produce a generated video or image. Examples of suitable diffusions model are described below in more detail. In some implementations, the denoising model may be implemented as a token generation neural network configured to generate an output sequence of multimodal tokens. In such implementations, the output sequence of multimodal tokens may not only comprise the above-described output visual tokens (e.g. a sequence of latent tokens representing the output video / image) but also multimodal tokens of other modalities (e.g., text tokens) and / or tokens representing properties of the output media item, such as media item understanding tokens and media item generation tokens. Generating the output sequence of multimodal tokens may comprise, at a particular position in the output sequence, performing parallel denoising steps to generate the latent tokens, while at other positions in the sequence, the token generation neural network autoregressively generates further multimodal tokens (e.g., discrete text tokens).

[0014] The denoising model comprises a self-attention layer implementing a self-attention mechanism. Processing the input token sequence comprises applying self-attention over theATTORNEY DOCKET NO. 45288-0665WO1series of successive token sub-sequences of the input token sequence, using the self-attention mechanism, to generate the plurality of output visual tokens. In other words, using the selfattention mechanism, self-attention is applied over the complete input token sequence.

[0015] In some implementations, the conditioning data may further comprise data defining a desired style of the generated target image or video. To this end, the input token sequence may further comprise a token sub-sequence comprising a fourth set of tokens in addition to the first set. second set and third set or sets of tokens. The fourth set of tokens may comprise a plurality of image tokens representing an input style image that defines a target style of the target image or the target video. For example, the input style image may define the target style by depicting an object or an environment in the target style.

[0016] In some implementations, the conditioning data may further comprise audio data representing one or more input reference audio clips (which may be obtained as user input). Accordingly, the input token sequence may further comprise a fifth set of tokens comprising a respective plurality of audio tokens representing respective input reference audio data (or a plurality of sets of fifth sets of tokens for a corresponding plurality of input reference audio data items). The plurality of audio tokens may be generated by processing the input reference audio data using an audio encoder. In such implementations, the first set of tokens may further comprise a plurality of input audio tokens (e.g., noisy audio tokens). Further in these implementations, the denoising model may be configured to generate, as output, i) the plurality of output visual tokens and ii) a plurality of output audio tokens. More specifically, the denoising model may generate the plurality of output visual tokens and the plurality of output audio tokens to be consistent, inter alia, with the input reference audio data by iteratively denoising the input visual tokens and the input audio tokens. For example, the generated target video may natively include a synchronized audio track that incorporates acoustic features of the input reference audio data (such as a voice identity of a character or an environmental acoustic context) decoded directly from the generated output tokens.

[0017] In some implementations, the conditioning data may further comprise video data representing one or more input reference videos (which may also be obtained as user input). Accordingly, the input token sequence may further comprise a sixth set of tokens comprising a plurality of video tokens representing input reference video data (or a plurality of sets of sixth sets of tokens for a corresponding plurality of input reference video data items). The plurality of video tokens may be generated by processing the input reference video data using a video encoder. When the conditioning data comprises the input reference video data, the output visual tokens generated by the denoising model comprise output video tokens representing the targetATTORNEY DOCKET NO. 45288-0665WO1video, which is generated to be consistent with the input reference video data. For example, the target video can be generated to incorporate spatiotemporal characteristics of an object or character depicted in the input reference video, such as facial structure and texture, facial expression variance, gait, body language, posture changes, and gestures (rather than merely replicating a static appearance).

[0018] In some implementations, the description may comprise one or more inline text tags to link the textual description to the diverse modalities of the conditioning data. More specifically, each inline text tag may associate a designated portion of the description with a respective input content image, input reference audio data, or input reference video data. The designated portion of the description may refer to, for example, a subject / character, an object, an action, or an environmental feature. Accordingly, the plurality of tokens of the second set of tokens comprises tokens representing the one or more inline text tags. For example, the textual description may embed a text tag immediately adjacent to the entity it modifies (e.g., "Person A <image_0> says <audio_0> ‘Hello’'’; in this example, <image_0> is an inline text tag associating the character "Person A'’ with the first input content image, and <audio_0> is an inline text tag associating the action “says” with a first input reference audio data). Providing explicit tags within the description may encourage the self-attention mechanism to directly cross-reference the tagged object or action with the corresponding encoded image, audio, or video tokens present in the input token sequence. Consequently, the denoising model may generate output tokens that are consistent with these explicitly mapped references, ensuring that the correct visual appearance and sound are applied precisely to the intended subject within the generated scene.

[0019] The method may further comprise generating, using a text encoder, the plurality of tokens of the second set of tokens from natural language input comprising the description of the target image or the target video. The natural language input may be textual input through a text input device such as a keyboard or touchscreen, or speech input received via a microphone and converted to text using a text-to-speech model. Trained language models may be used to supplement or rewrite the natural language input to generate an improved description. For example, an image-to-text model may process each input content image and (if present) the input style image to obtain tokens representing captions for the corresponding images. The tokens of the second set may then be generated based on an initial natural language description and the generated captions, either by concatenating them or by processing them using a text-to-text model to generate a modified description.ATTORNEY DOCKET NO. 45288-0665WO1

[0020] The input token sequence may further comprise (i.e. in addition to the first set, the second, the third set(s). and optionally the fourth set) a quality score token indicative of a target quality for the target image or the target video. The quality score may be a numerical value in a predefined range, such as between zero and one, and can be a predefined fixed value (e.g.0.7) or a controllable parameter input by a user.

[0021] The method may further comprise generating, using a first image encoder, the plurality of image tokens of the third set of tokens from the first input content image. When the conditioning data includes multiple input content images, i.e. when the token sub-sequences comprise more than one third set of tokens, the plurality of image tokens of each third set of tokens may be generated by processing the respective input content image using the first image encoder. This may involve processing the respective image using the first image encoder to generate initial embeddings, and processing those initial embeddings using a trained linear projection layers (“first linear projection layer”) to generate the tokens.

[0022] Similarly, a second image encoder may be used to generate the plurality of image tokens of the fourth set of tokens from the input style image (the second image encoder may be the same as or different from the first image encoder used to generate the third set of tokens). The respective trained linear projection layer (“second linear projection layer”) for processing the initial embeddings of the input style image to generate the image tokens may by different to the first linear projection layer, i.e. each linear projection lay er has its respective set ofleamable parameters.

[0023] The method may further comprise processing the plurality of output visual tokens, using a neural network decoder, to generate image data or video data for the target image or the target video. The video data may comprise a plurality of frames of video represented by a tensor of pixel values of dimension height, width, and color channels. The neural network decoder model may be a convolutional decoder model.

[0024] The denoising model may comprise a plurality of transformer layers comprising a plurality of the self-attention layers. One or more of the transformer layers may be global transformer layers that attend to all tokens in a respective input sequence, and one or more may be local transformer layers that attend to a sliding window of tokens (which that is smaller than the full sequence length). One of the transformer layers may implement the aforementioned self-attention layer that implements the attention mechanism for applying attention over the entire input token sequence.

[0025] When the output visual tokens represent a target video, each input visual token may comprise a latent representation of pixels of a patch of an input video and an input positionalATTORNEY DOCKET NO. 45288-0665WO1embedding representing a spatial and temporal position of the patch. The input positional embedding may be a relative positional embedding. The relative positional embedding may comprise a representation of a two-dimensional position of the patch of the input video in a frame of the input video, and a representation of a position of the frame in time. Furthermore, each image token of each third set of tokens generated from the input content image(s) may independently comprise a latent representation of a respective one or more pixels of a patch of the input content image and a content positional embedding. The content positional embedding may comprise, for each image token of each third set of tokens, a label embedding representing a label for the corresponding input content image. For example, the label may comprise an index of the input content image, such that the content positional embedding comprises a representation of a two-dimensional position of the patch of the input content image alongside a representation of the index of the input content image. The method may further comprise encoding in the input to the self-attention layer i) the relative positional embedding of each input video token and ii) the content positional embedding of each image token of each third set of tokens. This encoding may comprise encoding the relative positional embedding and the content positional embedding as respective vector rotations using one or more rotation matrices (e.g. Rotary Positional Embeddings or ROPE).

[0026] Flattening video latents into a one-dimensional sequence may result in the loss of inherent three-dimensional structure, such as width, height, and time. Advantageously, utilizing three-dimensional relative positional embeddings encoded as vector rotations explicitly provides spatial and temporal coordinates to the self-attention layer. This enables the denoising model to generalize across a mixture of different video resolutions and sequence lengths, rather than being constrained to a fixed resolution and duration. Furthermore, incorporating a label embedding into the content positional embedding beneficially allows the self-attention mechanism to unambiguously identify and differentiate between multiple distinct content images within the continuous input token sequence.

[0027] The input content image(s) may be image(s) of a real-world environment (e.g. captured by a camera). Similarly, the target image or video may similarly represent (depict) the real-world environment (e.g. the same real-world environment as the input content image(s)). More specifically, the target image / video may represent (depict) respectively a prediction of the real-world environment at a future moment in time or a prediction of the real-world over a future time period.

[0028] The method may comprise processing the target image or the target video to generate control data to control a mechanical agent in accordance with the target image / video to performATTORNEY DOCKET NO. 45288-0665WO1a task. More specifically, the generated prediction (i.e. the target image / video) may be used by a control system, e.g. using model predictive control, to control a mechanical agent, such as a (physical) robot, to perform a particular task, by processing the target image / video using the control system to generate control signals to control movement of the mechanical agent, in accordance with the target image / video prediction to perform a particular task such as moving an object within the environment or navigating within the environment. For example, the target image / video can depict the agent performing the task. That is the target image / video may represent predicted actions by the agent, e.g. movements of a robot arm, leg, or end effector. The task may be specified by conditioning data, e.g. by the description of the target image / video as represented by tokens of the second set of tokens and / or by the content image(s).

[0029] In some implementations, the system may generate a target image or a target video guided by a textual description and the acoustic or spatiotemporal characteristics of provided audio or video references, without strictly requiring static visual references. Thus, according to a second aspect of this specification, there is disclosed a computer-implemented method for generating a plurality of output visual tokens representing a target image or a target video. The method comprises obtaining an input token sequence comprising a series of successive token sub-sequences. The token sub-sequences comprise a first set of tokens, a second set of tokens, and at least a fifth set of tokens and / or a sixth set of tokens (wherein, for the sake of clarity, the enumeration of the sets of tokens corresponds to that used in the first aspect).

[0030] The first set of tokens comprises a plurality of input visual tokens. The second set of tokens comprises a plurality of tokens representing a description of the target image or the target video. The fifth set of tokens comprises a plurality of audio tokens representing input reference audio data. The sixth set of tokens comprises a plurality of video tokens representing input reference video data. In this aspect, the input token sequence does not strictly require a third set of tokens comprising image tokens representing an input content image or a fourth set of tokens comprising image tokens representing an input style image, although either or both may optionally be provided (as described above for the first aspect).

[0031] The method further comprises processing, using a denoising model, the input token sequence to generate the plurality of output visual tokens representing the target image or the target video. The denoising model comprises a self-attention layer implementing a selfattention mechanism, and processing the input token sequence comprises applying selfattention over the series of successive token sub-sequences of the input token sequence, using the self-attention mechanism, to generate the plurality of output visual tokens.ATTORNEY DOCKET NO. 45288-0665WO1

[0032] In some implementations, the input token sequence processed by the denoising model may further comprise the third set of tokens, wherein the third set of tokens comprises a plurality of image tokens representing a first input content image depicting an object. Furthermore, the input token sequence may optionally comprise a fourth set of tokens, wherein the fourth set of tokens comprises a plurality' of image tokens representing an input sty le image that defines a target style of the target image or the target video. In such implementations, the self-attention mechanism applies self-attention over the continuous sequence including the image-based tokens alongside the audio and / or video tokens.

[0033] According to another aspect of this specification, there is disclosed a computer-implemented method for training a denoising model (e.g. the denoising model of the first aspect) comprising a self-attention layer implementing an attention mechanism for applying attention over an input token sequence. The method comprises, for each of one or more training videos in a training dataset, obtaining a first set of tokens comprising a plurality of input visual tokens, and obtaining a second set of tokens comprising a plurality7of tokens representing a description of the training video.

[0034] The method further comprises sampling (e.g. randomly selecting), as a first input content image, a frame depicting an object from the training video, and generating, using a first image encoder, a third set of tokens comprising a plurality7of image tokens from the first content image. Generating these tokens may further involve applying data augmentation techniques to the sampled frames. For example, the system may detect people or objects in the video frames, create randomized crops, and augment these images via random rotation, flipping, or background replacement with uniform colors (e.g., white, black, or grayscale) or random backgrounds. This approach of bootstrapping data pairs directly from raw video overcomes limitations of approaches like fine-tuning per concept or style, which are often expensive and slow to serve. Sampling directly from raw training videos in this manner provides a source for observing specific objects under significant variation, enabling the model to leam object continuity7without requiring manually curated training pairs.

[0035] The method further comprises processing, using the denoising model, an input token sequence comprising the first, second, and third set of tokens to generate a plurality of output visual tokens representing a target video. Parameters of the denoising model are then updated based on a comparison of the target video and the training video.

[0036] In some implementations, the method may further comprise sampling, as respective further input content images, one or more further frames from the training video. For each further input content image, a respective further third set of tokens is generated using the firstATTORNEY DOCKET NO. 45288-0665WO1image encoder, with each further input content image depicting a respective obj ect. The input token sequence then further comprises each of the further third sets of tokens. Utilizing multiple sampled frames enables the system to learn to compose multiple assets or concepts simultaneously via in-context learning. This approach addresses drawbacks associated with parameter-efficient adaptation methods. For instance, attempting to compose multiple distinct Low-Rank Adaptations (LoRAs) for several distinct characters interacting within the same scene can lead to visual artifacts or a breakdown in subject identity.

[0037] The comparison of the target video and the training video to update the parameters can be performed in either latent space or image space. For a latent space comparison, the method may further comprise generating, using a video encoder, a plurality of video tokens from the training video, and updating parameters of the denoising model based on a comparison of the video tokens representing the training video and the output video tokens representing the target video. Alternatively, for an image space comparison, the method may further comprise processing the plurality of output video tokens using a neural network decoder to generate the target video, and updating the parameters of the denoising model based on a comparison of the target video and the decoded training video.

[0038] In further implementations, updating the parameters of the denoising model may comprise updating the parameters based on a comparison of a clip of the training video and the target video. As used herein, a clip of a video refers to a temporal segment comprising a continuous sequence of frames from the video, having a start time and an end time. The target video is then generated based on the sampled input content images and compared to the selected clip. The target video may be generated to have the same length as the clip. In such implementations, the input content images are sampled from frames of the training video that are not comprised in the clip of the training video, and may be randomly selected from such frames. The parameters of the denoising model may be updated based on a mean squared error loss of the clip of the training video and the target video.

[0039] Furthermore, when comparing based on a clip, the tokens of the second set of tokens may represent a description specifically of the clip of the training video rather than the entirety of the video. This specific description may be generated by processing the clip of the training video using a trained video-to-text model. In some implementations, the sampled input content images may also be provided to the video-to-text model to further guide the generation of the description of the clip.

[0040] In some implementations, generating the plurality of image tokens of the third set of tokens from the first input content image may comprise processing the first input content imageATTORNEY DOCKET NO. 45288-0665WO1using the first image encoder to generate an initial embedding, and processing the initial embedding using a first linear proj ection layer to generate the final image tokens. In such cases, the learnable parameters of the denoising model and the learnable parameters of the first linear projection layer may be jointly updated based on the comparison of the target video and the training video.

[0041] The training dataset may further comprise, for each training video, a respective input style image having the style of the training video. The method may further comprise generating, from the input style image using a second image encoder (NB. the second image encoder may be the same as or different from the image encoder used to generate the third set of tokens), a fourth set of tokens comprising a plurality of image tokens representing the input style image. Generating this fourth set may involve generating an initial embedding using the second image encoder and processing the initial embedding using a second linear projection layer, wherein the parameters of the second linear projection layer may be also jointly updated with the denoising model based on the comparison. The input token sequence would thus further comprise the fourth set of tokens.

[0042] The training videos and associated input style images in the training dataset may be synthetic data generated by other machine learning models. For example, the method may comprise generating a training video and an associated input style image for the training dataset by processing a natural language input using a text-to-image model to generate a target image and the input style image. The target image and input style image have the same style but depict different objects. The target image is then processed using an image-to-video model to generate the training video. Utilizing visual generative models as a synthetic data source enables the generation of training items over a diversity7of styles that might otherwise be difficult to source naturally.

[0043] In some implementations, the one or more training videos in the training dataset represent / depict a real -w orld environment.

[0044] After training the denoising model using the methods described above, the trained denoising model may be used for inference, i.e. for generating a plurality of output visual tokens representing a target image or a (further) target video. This may involve applying the inference generation methods described above for the first aspect to produce customized video or image outputs based on the user-provided reference data and textual descriptions.

[0045] In implementations in which the conditioning input includes audio and / or video inputs without image inputs, the above-described training method may be correspondingly adapted. Thus, according to a further aspect of this specification, there is disclosed a computer-ATTORNEY DOCKET NO. 45288-0665WO1implemented method for training a denoising model (e.g., the denoising model of the second aspect) comprising a self-attention layer implementing an attention mechanism for applying attention over an input token sequence. The method comprises, for each of one or more training items in a training dataset, wherein each training item comprises a respective training video, obtaining a first set of tokens comprising a plurality of input visual tokens, and obtaining a second set of tokens comprising a plurality of tokens representing a description of the training video.

[0046] The method further comprises obtaining, from the training item, reference audio data and / or reference video data. The reference audio data and / or reference video data may be extracted from portions of the training video (and / or its associated audio track) that are temporally distant from a target training clip. The method comprises generating a fifth set of tokens comprising a plurality of audio tokens representing the reference audio data, and / or a sixth set of tokens comprising a plurality’ of video tokens representing the reference video data (again, for the sake of clarity, the enumeration of the sets of tokens corresponds to that used in the first aspect). In this aspect, generating a third set of tokens or a fourth set of tokens representing image data is not strictly required, although either or both may optionally be generated and utilized (as described for the preceding training aspect).

[0047] The method further comprises processing, using the denoising model, an input token sequence comprising the first, second, and at least the fifth and / or sixth sets of tokens, to generate a plurality of output visual tokens representing a target video. Parameters of the denoising model are then updated based on a comparison of the target video and the training video.

[0048] In some implementations, the method may further comprise sampling, as a first input content image, a frame depicting an object from the training video, and generating, using an image encoder, a third set of tokens comprising a plurality of image tokens from the first content image. In such implementations, the input token sequence processed by the denoising model may further comprise the third set of tokens. Furthermore, the training dataset may optionally comprise an input style image having the style of the training video, and the method may further comprise generating, using the image encoder, a fourth set of tokens comprising a plurality of image tokens representing the input style image, such that the input token sequence further comprises the fourth set of tokens.

[0049] According to another aspect of this specification, there is provided a system comprising one or more computers and one or more storage devices communicatively coupled to the one or more computers. The one or more storage devices store instructions that, when executed byATTORNEY DOCKET NO. 45288-0665WO1the one or more computers, cause the one or more computers to perform the operations of the respective methods for generating a target image or video, or for training the denoising model.

[0050] According to another aspect, there are provided one or more non-transitory computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform the operations of the respective methods for generating a target image or video, or for training the denoising model.

[0051] According to another aspect, there is provided a graphical user interface for an image or video generation system configured to generate a target image or a target video from a textual description of the target image or the target video and one or more input content images depicting respective objects. The user interface is configured to receive as user input the textual description of the target image or the target video, alongside the one or more input content images. For example, the graphical user interface may provide a text input field to receive the textual description from a keyboard or speech-to-text input, and one or more image upload elements to receive up to three content images, sometimes referred to as assets or ingredients, from the user.

[0052] In some implementations, the image or video generation system may be configured to generate the target image or the target video from the textual description, the one or more input content images depicting respective objects, and an input style image that defines a target style of the target image or the target video. In such cases, the user interface may be further configured to receive as user input the input style image, for instance through an additional image selection or upload interface element.

[0053] The graphical user interface may provide a designated input mechanism that enables the user to explicitly separate and input discrete conditioning modalities (i.e. a text prompt alongside one or more specific content references and a style reference). By configuring the input in this manner, the interface allows the user to directly set the multi-modal processing conditions for the underlying generative model, overcoming the technical limitation of attempting to articulate complex, specific visual details solely through textual input.

[0054] Particular embodiments of the subject matter described in this specification can be implemented so as to realize one or more of the following advantages.

[0055] Implementations of the described techniques enable versatile and highly controllable image or video generation. The proposed “in-sequence conditioning” approach (i.e., using a denoising model to process a continuous, flattened token sequence comprising visual target tokens alongside conditioning data) provides a robust technical framework for integrating reference data of varying modalities, including textual descriptions, content images, and styleATTORNEY DOCKET NO. 45288-0665WO1images. A particular advantage of the described techniques is the ability to coherently incorporate and compose content from multiple distinct content images simultaneously. This achieves multi-object composition via in-context learning, avoiding the visual artifacts and high computational overhead associated with per-concept fine-tuning or parameter-efficient adaptations.

[0056] Furthermore, the described training techniques overcome data scarcity challenges. It is advantageous that the training items can be generated using a synthetic data generation pipeline, for example, by utilizing readily available text-to-image and image-to-video models. This is particularly advantageous when the denoising model is trained to control the style of the target videos, as the synthetic pipeline enables the generation of perfectly matched imagevideo training pairs over a wide range of artistic styles which are otherwise difficult to obtain. Additionally, by bootstrapping content training data directly from raw video (e.g. by extracting a target clip and sampling input frames from the remainder of that same video) the system can learn strict object continuity and spatiotemporal reasoning without requiring meticulously curated manual datasets.

[0057] Furthermore, the techniques described herein relate to digital image and video signal processing. The generated output visual tokens and the resulting target image or target video define physical parameters (e.g., pixel or voxel values comprising color channel data) suitable for rendering on a physical display device. The described in-sequence conditioning and selfattention techniques improve digital video generation by increasing temporal consistency of specific objects across multiple video frames, suppressing visual artifacts such as texture sticking, and coherently composing multiple reference signals within a single continuous token sequence. This architecture thereby reduces the computational overhead and memory bandwidth otherwise required for parameter-efficient adaptation methods (e.g., LoRAs) or per-concept fine-tuning.

[0058] The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.BRIEF DESCRIPTION OF THE DRAWINGS

[0059] FIG. 1 shows an example computer system.

[0060] FIG. 2 shows an example input token sequence.ATTORNEY DOCKET NO. 45288-0665WO1

[0061] FIG. 3 is a flow diagram of an example process of generating a plurality of output visual tokens representing a target image or a target video.

[0062] FIG. 4 illustrates an example of the process of FIG. 3.

[0063] FIG. 5 shows an example computer system for training a denoising model.

[0064] FIG. 6 is a flow diagram of an example process of training a denoising model.

[0065] FIG. 7 illustrates a sampling step of the example process of FIG. 6.

[0066] FIG. 8 shows an example graphical user interface.

[0067] FIG. 9 shows a further example computer system.

[0068] FIG. 10 shows a further example input token sequence.

[0069] FIG. 11 shows a further example computer system for training a denoising model.

[0070]

[0071] Like reference numbers and designations in the various drawings indicate like elements.DETAILED DESCRIPTION

[0072] Deep generative models can synthesize high-fidelity images and videos based on textual descriptions. However, relying solely on text is often insufficient to articulate complex visual features or enforce strict visual consistency, such as maintaining a particular character's identity across generations. Possible ways of addressing this issue involve fine-tuning a generative model on a per-concept basis or applying parameter-efficient adaptations, such as Low-Rank Adaptations (LoRAs). However, these techniques can introduce substantial computational overhead and often lead to visual artifacts when attempting to compose multiple distinct concepts within the same scene.

[0073] To address these challenges, the present disclosure describes systems and methods that provide versatile, multi-modal conditioning via an “in-sequence?’ architecture. As described below, embodiments of this architecture may process continuous token sequences comprising both visual targets and reference data to achieve multi-object composition via in-context learning, overcoming the limitations of text-only prompts and per-concept fine-tuning.

[0074] Referring to FIG. 1 and FIG. 2, an example computer system 100 is shown for generating a target video 101. The computer system 100 is an example of a system, implemented as computer programs on one or more computers in one or more locations, in which the systems, components, and techniques described below are implemented. In broad terms, the computer system 100 is configured to generate a target video 101 (or a target image in some implementations) based on user-provided references. To this end. the computer system 100 is configured to receive user input 110, process an input token sequence 102 (obtained,ATTORNEY DOCKET NO. 45288-0665WO1inter alia, from the user input 110) using a denoising model 120 and generate the target video 101 (or target image) based on the output of the denoising model 120. The user input 110 may be obtained from a user (e.g. via a user interface) or from a software application in communication with the system 100.

[0075] More specifically, the system 100 is configured to receive the user input 110 comprising a combination of modalities to condition the video generation process. The user input 110 may comprise a natural language input 111, image data representing one or more content images 1 12, and optionally image data representing a style image 113. The natural language input 111 comprises a textual description (e.g., a text prompt) of the target video 101 to be generated (e.g., describing a desired scene, action, or subject matter). This textual description may be obtained directly via text input through a text input device (e.g., a keyboard or touchscreen), or it may be obtained from speech input received via a microphone and converted to text using a speech-to-text model. The one or more content images 112 depict respective objects, thereby providing specific visual assets or subjects (e.g., a specific character or item) to be incorporated into the target video 101. The optional style image 113 defines a target style for the target video 101, for example by providing global visual characteristics (e.g., a colour palette, lighting conditions, texture, or rendering style) to be applied to the generated video.

[0076] To process the user input 110, the system 100 may optionally comprise a rewriter 130. The rewriter 130 may be implemented as a software module comprising one or more trained machine learning models, such as an image-to-text model (e.g., a Vision-Language Model or an image captioning network) and a text-to-text model (e.g., a Large Language Model or LLM). In broad terms, the rewriter 130 is configured to process the natural language input 111 to generate a modified textual description of the to-be-generated target video 101. The modified textual description may be enriched compared to the initial natural language input 111. This enrichment is particularly useful for supplementing user-provided text prompts that may be sparse or lack sufficient descriptive detail. For example, the rewriter 130 may generate descriptive captions for the content images 112 and the style image 113. Subsequently, the rewriter 130 may modify the original natural language input 111 based on these generated captions to produce the modified textual description of the target video 101.

[0077] The rewriter 130 may generate the modified textual description in various ways. In one implementation, the rewriter 130 may simply concatenate or append the generated captions for the content images 112 and the style image 113 to the original natural language input 111. The resulting concatenated string is then utilized directly as the modified textual description. Alternatively, the rewnter 130 may process the initial natural language input 111 and theATTORNEY DOCKET NO. 45288-0665WO1generated captions using the text-to-text model (e.g., the LLM). In this approach, the text-to-text model generates a modified textual description that integrates the visual features extracted from the reference images with the semantic content of the initial natural language input 111. In doing so, the text-to-text model may synthesize a cohesive text that reformulates or rephrases the initial natural language input 111, such that the modified textual description does not necessarily include the original text verbatim.

[0078] The system 100 further comprises a text encoder 140 configured to process the textual description (e.g., the initial natural language input 111 or, when the rewriter 130 is used, the modified textual description generated by the rewriter 130) to generate a set of text tokens 105. The set of text tokens 105 may comprise a sequence of M individual text tokens, denoted as G, In general, a “token” may refer to a numerical representation, such as a multidimensional vector or embedding, that encodes semantic or visual information into a continuous latent space processable by a neural network. The text tokens 105 may represent words, wordpieces (e.g., sub-words or parts of words), or characters in a natural or computer language (e.g., programming or markup language). The text encoder 140 may be implemented using any of a variety of machine learning architectures, such as a trained language model (e.g., a text-to-text model or an image-to-text model). In some implementations, the text encoder 140 comprises a Transformer-based architecture including one or more transformer layers or selfattention layers, a specific example of which is the UL2 model.

[0079] The system 100 further comprises one or more image encoders 150, 160 to process image data inputs. A first image encoder 150 is configured to process the image data representing the one or more content images 112 to generate content image tokens 106. More specifically, each content image is processed using the first image encoder 150 to generate a corresponding set of tokens. In the example of FIG. 2, L content images have been processed using the first image encoder 150 to generate corresponding L sets of tokens 109, so that the content image tokens 106 comprise L sets of tokens 109 (e.g., from a 1st to an L-th content image) of individual tokens denoted as c1... cL Kwhere ct... c1 Kdenote the tokens of the set of tokens representing the first content image, and c1 L... cL Kdenote the tokens of the set of tokens representing the L-th content image. While in this example, each content image is tokenized into the same number of tokens (K tokens), it is to be understood that in other implementations, the number of tokens in different ones of the third sets of tokens may be different.ATTORNEY DOCKET NO. 45288-0665WO1

[0080] Similar to the text tokens 105, these image tokens 106 comprise numerical representations, such as latent feature vectors or embeddings, that encode visual information (e.g., object features, textures, or global styles) in a continuous latent space. Specifically, each image token of the content image tokens 106 may comprise a latent representation of a respective one or more pixels of a patch of the corresponding input content image. Optionally, each image token may further comprise a content positional embedding. The content positional embedding may comprise i) a representation of a two-dimensional position of the patch within the input content image and ii) a label embedding (e g., an index) representing a label for the corresponding input content image. This label embedding allows the downstream model (e.g., the self-attention layers of the denoising model 120) to distinguish between tokens originating from different input content images when processing the complete input token sequence 102.

[0081] The image encoders 150 may be implemented as using any of a variety of architectures, such as a convolutional encoder or an encoder pre-trained j ointly i th a decoder in an autoencoder framework. As one example, the image encoder 150 may be implemented as a fully convolutional autoencoder. In some implementations, the image encoder 150 may utilize a deflation approach wherein weights and biases of one-dimensional temporal convolutions are summed to apply a pointwise linear transformation (to efficiently process static images within a video-native architecture). Furthermore, the image encoder 150 may utilize factorized spatial and temporal convolutions, including downsampling by strided convolutions, to compress the visual data. In some implementations, the image encoder 150 employs an asymmetric design relative to the below-described decoder 170 (e.g., having fewer parameters) to minimize the mixing of information across time and space, thereby improving the predictability of the resulting latents for the denoising model 120.

[0082] Regardless of its exact architecture, the image encoder 150 may further utilize a trained linear projection layer ("first linear projection layer”), such as a fully connected neural network layer or a dense layer, to map initial embeddings into the plurality of image tokens.

[0083] The system 100 may further comprise a second image encoder 160. More specifically, when an input style image 113 defining a target style is provided, the system 100 utilizes the second image encoder 160 to process the image data representing the style image 113 to generate a set of style image tokens 107. The utilizes the second image encoder 160 may be the same model as or a different model from the first image encoder 150. As illustrated in FIG.2, the style image tokens 107 may comprise a sequence of P individual tokens denoted as Si ... s1 P. Similar to the content image tokens 106, each style image token may comprise aATTORNEY DOCKET NO. 45288-0665WO1latent representation of a respective one or more pixels of a patch of the input style image. Furthermore, each style image token may optionally comprise i) a style positional embedding representing the two-dimensional position of the patch within the input sty le image, and ii) a label embedding. This label embedding allows the downstream model (e.g., the self-attention layers of the denoising model 120) to specifically identify and distinguish these tokens as styleconditioning tokens when processing the complete input token sequence 102. To generate the style image tokens 107, the input style image 113 may be processed using the image encoder 160 to generate an initial embedding, and the initial embedding may then be processed using a trained linear proj ection layer ("second trained linear proj ection layer”) to generate the plurality of image tokens of the fourth set of tokens.

[0084] The system 100 is configured to construct or otherwise obtain the input token sequence 102 that serves as the input to the denoising model 120. As illustrated in FIG. 2, the input token sequence 102 comprises a series of successive token sub-sequences. Specifically, the input token sequence 102 comprises a first set of tokens comprising a plurality of noisy input visual tokens 103, a second set of tokens comprising the text tokens 105, and one or more third sets of tokens comprising the content image tokens 106 (each third set of token comprises the image tokens generated for a corresponding content image). When an input style image 113 is provided, the input token sequence 102 further comprises the fourth set of tokens comprising the style image tokens 107, as shown in FIG. 2.

[0085] The noisy input visual tokens 103. denoted as... vN, represent an input noise video (or an input noise image when the system is used to generate target images rather than target videos). For example, the input noise video (or image) can comprise a noisy video (or image) sampled from a predefined noise distribution, such as a Gaussian noise distribution having a zero mean and unit variance. Additionally, the input token sequence 102 may comprise one or more auxiliary tokens 104.

[0086] As shown in FIG. 2, the auxiliary tokens 104 may comprise a quality score token (e.g., denoted as (?) indicative of a target qualify for the target image or video. The qualify score can be a numerical value in a predefined range (e.g., between zero and one), and it can be a predefined fixed value or a controllable parameter input by a user. Generally, training datasets include visual data spanning a wide range of visual qualify, and corresponding textual descriptions typically omit indicators of visual qualify. Providing the qualify score token to the denoising model 120 may mitigate the tendency of the denoising model 120 to sample randomly from the overall quality distribution of the training data. For example, during training, qualify scores can be precomputed for all training videos or images based on anATTORNEY DOCKET NO. 45288-0665WO1internally trained score model. During inference, a target quality value may be embedded as the quality score token and added to the input token sequence 102.

[0087] Additionally or alternatively, the auxiliary tokens 104 may comprise one or more tokens representing a current denoising time step (e.g., denoted as T). As described below in more detail, the denoising model 120 may be implemented as a diffusion model that generates the target video iteratively over a sequence of steps, in which case the one or more tokens representing a denoising time step allow the model to track the current step of the reverse diffusion process and accurately estimate the appropriate scale of noise to remove from the noisy input visual tokens 103 at that specific step.

[0088] The second set of tokens (comprising the text tokens 105), the third set(s) of tokens (comprising the content image tokens 106), and the fourth set of tokens (comprising the style image tokens 107) collectively serve as conditioning data to guide the below described denoising process performed by the denoising model 120. To perform in-sequence conditioning, the system 100 concatenates or otherwise sequentially arranges this conditioning data alongside the first set of tokens (comprising the noisy input visual tokens 103) into a single, continuous sequence to form the input token sequence 102. The one or more auxiliary tokens 104 (e.g., the time step T and quality score Q) may also be treated as distinct conditioning elements that are concatenated alongside the visual and text tokens, allowing the self-attention layers of the denoising model 120 to attend directly to these parameters. The sequence order of the token sub-sequences within the input token sequence 102 can vary. In some implementations, as depicted in the example of FIG. 2, the first set of tokens precedes the second set of tokens, which in turn precedes a set of one or more auxiliary tokens 104, followed by the third set(s) of tokens and the fourth set of tokens. However, it is to be understood that in other implementations, the sequential order of the token sub-sequences may be different. For example, the second set of tokens may precede the first set of tokens, or the auxiliary tokens 104 may be placed at the very beginning or the very end of the input token sequence 102.

[0089] The denoising model 120 is configured to receive the input token sequence 102 and process this continuous sequence to iteratively denoise the noisy input visual tokens 103 over a plurality of denoising time steps to generate a plurality of output visual tokens (where each denoising time step may correspond to one or more denoising iterations or forward passes of the model). As an input, the denoising model 120 takes the fully concatenated input token sequence 102, which includes both the data to be denoised (the first set of tokens) and the conditioning data (the second set of tokens, the third set(s) of tokens, and optionally the fourthATTORNEY DOCKET NO. 45288-0665WO1set of tokens and / or the auxiliary' tokens). Each token in the input token sequence 102 may be represented as a numerical vector in a common embedding space having a predefined dimensionality. To facilitate processing within the common embedding space, each token in the input token sequence 102 may be projected to a common dimensionality prior to, or upon, input to the denoising model 120. This may be achieved directly by the above-described encoders 140, 150. 160 or via one or more linear layers or embedding layers downstream of the encoders (not shown in Figure 1).

[0090] In broad terms, the denoising model 120 may be configured to predict a noise component present in the noisy input visual tokens 103 at a given denoising time step T, or alternatively, to directly predict a denoised (clean) representation of the visual tokens. The denoising model 120 comprises one or more self-attention layers to implement the abovedescribed in-sequence conditioning. Within these self-attention layers, the system implements self-attention mechanisms (e.g., scaled dot-product attention) computed across the entire input token sequence 102. Specifically, during self-attention operations, the noisy input visual tokens 103 attend directly to the text tokens 105, the content image tokens 106. the style image tokens 107 (when present), and the auxiliary tokens 104 (when present). Because all these tokens are part of the same continuous sequence, the model globally integrates the semantic guidance from the text, the visual constraints from the reference images (i.e. the content and sty le images), and the control parameters (like the quality score Q) simultaneously at every selfattention layer without requiring separate cross-attention pathways.

[0091] In some implementations, the denoising model 120 may be a Transformer-based neural network architecture comprising a plurality' of transformer layers. These transformer layers may comprise one or more global transformer layers and one or more local transformer layers. Each global transformer layer is configured to perform a self-attention operation across all tokens in a respective input sequence, such as the concatenated input token sequence 102. Each local transformer layer is configured to perform a self-attention operation across a sliding window' of tokens within a respective input sequence, for example, by restricting the attention scope of a given token to a predefined neighbourhood of adjacent tokens. One of these transformer layers (e.g.. a global transformer layer) implements the aforementioned selfattention layer for applying attention across the complete input token sequence 102.

[0092] The inclusion of both global and local transformer layers allows the denoising model 120 to capture different levels of dependencies w ithin the input token sequence 102. The global transformer layers capture long-range dependencies between the conditioning data (e.g. including the tokens representing the distinct objects or characters from the content images andATTORNEY DOCKET NO. 45288-0665WO1the style reference) and the visual tokens to be denoised. This allows the model to learn “incontext” from the provided content images to synthesize a video that accurately depicts the specified objects. The local transformer layers process fine-grained spatial or temporal details within the sequence. By utilizing this hierarchical attention structure, the model reduces the total number of attention computations required compared to a purely global architecture, which facilitates the processing of high-resolution image or video data.

[0093] In some implementations, the self-attention mechanisms of the denoising model may be applied without a causal mask (enabling video tokens to attend bidirectionally to all other video and conditioning tokens in the sequence).

[0094] The denoising model 120 may employ positional and label embeddings to maintain spatial, temporal, and source identity during the self-attention process. For the first set of tokens (the noisy input visual tokens), the denoising model 120 may apply an input positional embedding representing a spatial and temporal position of each patch within the target video or image. For the third sets of tokens (those derived from the input content images), the denoising model 120 may apply a content positional embedding that comprises a spatial component and a temporal component. In this implementation, the temporal component of the content positional embedding serves as the label (e.g., an index) for the corresponding input content image. Specifically, the denoising model 120 may assign a unique value to the temporal component for each respective input content image (for example, a first value (e.g. ‘0’) for a first input content image, a second, different value (e.g. ‘1’) for a second input content image, and so on) to enable the denoising model 120 to distinguish between tokens originating from different content images. Similarly, for the fourth set of tokens (the style image tokens), the denoising model 120 applies a sty le positional embedding representing a spatial position of the patch within the input style image, along with a style label embedding that identifies these tokens as style-conditioning data.

[0095] The encoding of these positional and label embeddings may be implemented as respective vector rotations using one or more rotation matrices. Specifically, the denoising model 120 may apply these vector rotations (e.g., Rotary' Positional Embeddings) to queries and keys formulated within its self-attention layers. In some implementations, the denoising model 120 may apply the vector rotations to a subset of the components of the token vectors, thereby modifying the numerical values of said components to encode positional or label information while preserving the original representation in the remaining components. By incorporating geometric and index-based relationships (where the index is represented via the temporal encoding component) directly into the rotation of these vectors, the denoising modelATTORNEY DOCKET NO. 45288-0665WO1120 can mathematically preserve the identity', relative positioning, and source-type of the different inputs even when they are processed as part of a single, continuous input token sequence 102.

[0096] The denoising model 120 may' be configured to generate, at each denoising time step, output that is used to update the noisy input visual tokens, i.e., to progressively refine the visual representation. Specifically, for each iteration (e.g. for each forward pass through the transformer layers, when present, of the denoising model 120), the denoising model 120 produces a prediction for the positions in the output sequence corresponding to the first set of tokens (the noisy input visual tokens). For the remaining positions in the sequence corresponding to the conditioning data (e.g., the second, third, and fourth sets of tokens), a mask (e.g., a loss mask or update mask) may be applied to ensure that the update is restricted to the visual tokens. The prediction (which may represent an estimate of a noise component, an estimate of denoised visual tokens, or a score) may be utilized to perform a reverse diffusion step to update the representations of the visual tokens. While the denoising model 120 processes the fully concatenated input token sequence 102 to allow for global attention across all conditioning data, the conditioning data itself associated with the user input 110 (e.g., the text tokens, the content image tokens, and the style image tokens) may remain invariant at the beginning of each denoising time step (it is to be understood that the above-described time step token may be updated at every denoising time step so as to identify the current denoising time step). This ensures that the conditioning information provides a stable and consistent reference to guide the synthesis of the target video or image throughout the plurality of time steps.

[0097] In broad terms, the denoising model 120 is trained to leam the '‘in-sequence conditioning"’ relationship between the disparate modalities in the input token sequence 102. During training, the model leams to associate features in the textual description and the content / style images with corresponding visual patterns in the target video (or image). This learning process enables the model to perform zero-shot synthesis of specific characters, objects or sty les by attending to the provided tokens in the concatenated sequence. An example training process, including data bootstrapping techniques and the example loss mechanisms for optimizing the model parameters, is described below with reference to FIG. 5 and FIG. 6.

[0098] Referring back to FIG. 1, the system 100 further comprises a neural network decoder 170 configured to receive as input a sequence of visual tokens and to process the input to generate a video (or image). More specifically, the decoder 170 is configured to process the output of the denoising model 120, i.e. the plurality of output visual tokens representing the target video (or image), to generate the target video 101 (or image). As noted above, theATTORNEY DOCKET NO. 45288-0665WO1plurality of output visual tokens generated by the denoising model 120 are “denoised” visual tokens obtained after the iterative denoising process (i.e. as a result of the final denoising iteration).

[0099] In other words, the decoder 170 is configured to map the latent representations (tokens) back into pixel space to generate the target video 101 (e.g. a video of dimension (T, H, W, C)) or target image (e.g. an image of dimension (H, W, C)). The decoder may comprise a plurality of convolutional layers. A convolutional layer may comprise one or more two-dimensional spatial convolutions and / or one or more one-dimensional temporal convolutions. In some examples, the decoder may comprise one or more skip connections, e.g., the decoder may comprise a U-Net model. In some examples, the decoder may be a decoder model of a variational autoencoder (VAE) model, where the VAE model encodes input video into the latent space of the latent representation using an encoder, then decodes the latent representation of the input video back into pixel space using the decoder model. More specifically, in video generation implementations, the decoder 170 may comprise a spatial-temporal decoder utilizing a fully convolutional design (e.g., omitting attention layers) to enable the encoding and decoding of varying resolutions and frame counts. To ensure high-fidelity reconstruction and motion consistency, the decoder 170 may employ factorized spatial and temporal convolutions (e.g. 2D convolutions in space and ID convolutions in time) alongside spatiotemporal residual stacks comprising convolutional blocks with residual connections. To mitigate motion artifacts and minimize discrepancies at boundaries when processing video in chunks, the decoder 170 may utilize reflect padding at the boundaries of its convolution operations rather than zero padding. For processing image data within this same architecture, the decoder 170 may utilize a deflation approach wherein weights and biases of temporal convolutions are summed to apply a pointwise linear transformation, effectively treating the image as a static video without requiring explicit tiling.

[0100] In some implementations, the decoder 170 may implement a cascaded decoding architecture configured to enhance the resolution of the target video 101 and mitigate visual artifacts (e.g., “texture sticking”). In such an implementation, the decoder 170 may first utilize a secondary denoising model (e.g., a latent-to-latent (L2L) diffusion model) to generate visual representations in a secondary, less compressed latent space, before mapping the resulting representations to the pixel space. To generate long-duration videos (e.g., exceeding a predefined frame count) within hardware memory constraints, the system may perform decoding in overlapping spatiotemporal chunks. To ensure temporal continuity and avoid visible “seams” between these chunks, the decoder 170 may utilize frame conditioning.ATTORNEY DOCKET NO. 45288-0665WO1wherein the decoding of a current spatiotemporal chunk is conditioned on one or more high-resolution latent frames from a previously decoded chunk. The overlapping regions of the decoded chunks are then merged using smooth interpolation to produce a seamless, continuous target video 101.

[0101] FIG. 3 is a flow diagram of an example process 300 of generating a plurality of output visual tokens representing a target image or a target video. The process 300 of FIG. 3 may be implemented by one or more computers in one or more locations. For example, the process 300 may be implemented by the system of FIG. 1, and for convenience the process is described with reference to FIG. 1 and FIG. 2.

[0102] At an initial step 302, the input token sequence 102 is obtained based on input 110 from a user (e.g. via a user interface) or from a software application in communication with the system 100. The input token sequence 102 obtained at step 302 comprises a series of successive token sub-sequences. As illustrated in FIG. 2, these sub-sequences may comprise: (i) a first set of tokens comprising a plurality' of input visual tokens 103 (e.g., noisy latent tokens representing an input noise video or image); (ii) a second set of tokens comprising text tokens 105 representing a description of the target video 101 or target image; and (lii) one or more third sets of tokens comprising image tokens 106 representing respective input content images 112. In some implementations, the input token sequence 102 further comprises a fourth set of tokens comprising image tokens 107 representing an input style image 113 that defines a target style for the generation process. Additionally, the input token sequence 102 may comprise one or more auxiliary tokens 104, such as a qualify score token indicative of a target qualify’ or tokens representing a denoising time step.

[0103] Obtaining the first set of tokens comprising the plurality of input visual tokens 103 may involve initialising a sequence of latent tokens representing an input noise video or an input noise image. For example, the system 100 may sample the input visual tokens 103 from a predefined noise distribution (e.g., a standard normal distribution). In broad terms, these sampled tokens may act as a noisy latent “canvas'’ from which the final target image or target video 101 can be iteratively synthesized.

[0104] Obtaining the second set of tokens 105 may involve (directly) processing natural language input 111 using a text encoder (e.g., the above-described text encoder 140, e g. implemented as a UL2 model) to generate the text tokens of the second set of tokens 105. Alternatively, the text tokens may be obtained by first processing the natural language input 111 using the above-described rewriter 130 to generate a modified description. The rewriter 130 may use one or more trained language models to expand, refine, or otherwise enrich theATTORNEY DOCKET NO. 45288-0665WO1initial natural language input 111. For example, the rewriter 130 may generate captions for the input content images 112 and the input style image 113 (when present) and integrate these captions with the semantic content of the initial natural language input 111 to generate a cohesive modified description that integrates visual features extracted from the content / style images. This may ensure that the description provides sufficient semantic detail to guide the denoising model 120 in synthesizing high-fidelity visual data that aligns with the user’s intent. When the rewriter 130 is used, the modified description is then processed by the text encoder 140 to generate the set of text tokens 105.

[0105] Obtaining the third set(s) of tokens 106 may comprise receiving input content image(s) 112 depicting object(s) and processing the input content image(s) 112 using the abovedescribed image encoder 150. The first image encoder may process each input content image 112 to generate the corresponding third set of tokens comprising a respective sequence of image tokens wherein each image token comprises alatent representation of one or more pixels of a spatial patch of the corresponding input content image.

[0106] Obtaining the fourth set of tokens 107 may comprise receiving an input style image 113 defining a target style and processing the input style image 113 using the above-described second image encoder 160 to generate the fourth set of tokens 107 comprising a respective sequence of image tokens wherein each image token comprises a latent representation of one or more pixels of a spatial patch of the corresponding input style image.

[0107] Furthermore, obtaining the input token sequence 102 may further involve generating one or more auxiliary tokens 104. For example, a quality score token indicative of a desired output quality may be obtained, and / or tokens representing a current denoising time step may be generated (e.g., as an embedded vector representation of the denoising time step) to inform the denoising model 120 of the current denoising time step of the iterative denoising process.

[0108] At step 304, the input token sequence 102 is processed using the above-described denoising model 120. As described above, the denoising model 120 comprises at least one selfattention layer implementing a self-attention mechanism to process the concatenated visual data and conditioning data as a single continuous sequence. Processing the input token sequence 102 involves applying the self-attention mechanism over the complete series of successive token sub-sequences. To provide the self-attention mechanism with spatial and temporal context, processing the input token sequence 102 may further comprise applying positional embeddings to the tokens. For example, as described above with reference to FIG.1, three-dimensional relative positional embeddings (such as three-dimensional Rotary Positional Embeddings) may be applied to the input visual tokens 103 to encode their spatialATTORNEY DOCKET NO. 45288-0665WO1and temporal coordinates, while one-dimensional or two-dimensional positional embeddings may be applied to the text tokens 105 and image tokens 106, 107. In some implementations, a global self-attention mechanism is applied over the entirety of the input token sequence 102. By applying self-attention over the complete sequence and utilizing the positional embeddings, the denoising model 120 enables the input visual tokens 103 to attend simultaneously to the semantic context of the description (the second set of tokens 105) and the visual features of the content / style image(s) (the third and fourth sets 106, 107).

[0109] At step 306, a plurality of output visual tokens representing the target image or the target video 101 are generated. This generation may be performed iteratively over a plurality of denoising time steps, where updated input visual tokens are generated based on the output of the denoising model 120 at each step (e.g., by performing a reverse diffusion step). Once the iterative denoising is complete, the final plurality of output visual tokens can be decoded using the decoder 170 to map the latent representations back into a pixel space, yielding the target image or the target video 101.

[0110] FIG. 4 illustrates an example of the above-described video / image generation techniques. In this example, the user input comprises a natural language input 401 comprising the text string (“A dog catching a ball in the park”) and three content images 402, 403, 404 respectively depicting the extinct volcano Arthur’s Seat, a Golden Retriever, and ahollow mesh ball. In this example, no style image is provided as part of the user input. By performing the process 300, the system 100 processes the user input to generate a corresponding output video. An example frame 405 of the output video is shown in FIG. 4. It can be seen that the example frame 405 is consistent with the user input in that it depicts a Golden Retriever catching the mesh ball on a lawn with Arthur’s Seat in the background.[01U] FIG. 5 shows a system 500 implemented as computer programs on one or more computers in one or more locations, for training the above-described denoising model 120 (defined by a plurality of trainable parameters) and / or the first / second linear projection layer(s) of the first and second encoders 150, 160. The system 500 comprises a training dataset 510, a data extraction module 530, the text encoder 140, the image encoders 150 and 160, the denoising model 120, the decoder 170, and a training engine 520. In broad terms, the system 500 is configured to train the denoising model 120 (and optionally the linear projection layers of the image encoders 150, 160) to perform the in-sequence conditioning by utilizing pairs of target videos and sampled content images.

[0112] The training dataset 510 comprises a plurality of training items 511. Each training item 511 comprises a target video 512, and optionally, an associated style image 513 having theATTORNEY DOCKET NO. 45288-0665WO1same style as the target video 512. In some implementations, the target videos 512 represent a real -world environment. In other implementations, the training dataset 510 includes synthetic training data generated using further trained machine learning models. For example, the system may generate a target video 512 and an associated input sty le image 513 by processing a natural language input using a text-to-image model to generate a target image and the input style image 513, such that they have the same style but depict different objects, and subsequently processing the target image using an image-to-video model to generate the target video 512. Advantageously, this synthetic data generation pipeline enables the generation of training items across a wide range of styles that may otherwise be difficult to obtain. Furthermore, leveraging synthetic data mitigates challenges associated with data scarcity and the manual curation of large, specialized datasets of reference-video pairs.

[0113] The data extraction module 530 is configured to obtain, during each training iteration, a respective target video 512 from the training dataset 510 and extracts a target clip 531. The data extraction module 530 further samples one or more frames depicting an object directly from the target video 512 to serve as one or more input content images 532. In some implementations, the data extraction module 530 randomly selects the input content images 532 from frames of the target video 512 that are not comprised within the selected target clip 531. Sampling reference images from outside the target clip may force the denoising model 120 to leam robust object continuity and zero-shot composition, rather than merely relying on temporal adjacency.

[0114] The system 500 utilizes a video-to-text model 540 to process the target clip 531 to generate a textual description of the clip. In some implementations, the sampled input content images 532 may also be provided to the video-to-text model 540 and / or the rewriter 130 to further guide the generation of the description of the training clip. The text encoder 140 then processes this description to generate a second set of tokens representing the description of the training video.

[0115] The first image encoder 150 processes the sampled input content image(s) 532 to generate one or more third sets of tokens, while the second image encoder 160 processes the style image 513 (when present) to generate a fourth set of tokens. As described above, processing the input content image(s) 532 and the style image 513 may comprise using the respective image encoders 150, 160 to generate initial embeddings, which are then processed using respective first and second linear projection layers to generate the final image tokens.

[0116] The system 500 constructs a training input token sequence 501 comprising a first set of tokens (e.g., noisy input visual tokens 103), the second set of tokens from the text encoder 140,ATTORNEY DOCKET NO. 45288-0665WO1the third set(s) of tokens from the image encoder 150, and optionally the fourth set of tokens from the image encoder 160. and / or one or more auxiliary tokens 104.

[0117] The denoising model 120 processes the training input token sequence 501 to generate a plurality of output visual tokens representing a training video. The training engine 520 then computes updates 503 for the parameters of the denoising model 120 based on a comparison of the target video 512 (e.g., the target clip 531) and the generated training video. The parameters of the denoising model 120 may be updated based on a mean squared error (MSE) loss between the target clip 531 and the training video.

[0118] In some implementations, the comparison of the target video and the training video is performed in pixel space. Specifically, the decoder 170 may process the output visual tokens to generate the training video 502 in pixel space, and the training engine 520 updates the parameters based on a comparison of the target clip 531 and the decoded training video 502. In other implementations, the comparison is performed in a latent space. In such implementations, the system generates a plurality' of video tokens from the target clip 531 using a video encoder, and the training engine 520 updates the parameters of the denoising model 120 based on a comparison of the encoded video tokens representing the target clip 531 and the output visual tokens generated by the denoising model 120 representing the training video.

[0119] In implementations where the first and / or second linear projection layers are used within the image encoders 150, 160 to map the initial embeddings into the common token space, the training engine 520 may jointly update the parameters of the first and / or second linear projection layers alongside the parameters of the denoising model 120 based on the comparison of the target video and the training video.

[0120] FIG. 6 is a flow diagram of an example process 600 for training the above-described denoising model 120 (defined by a plurality of trainable parameters) and / or the first / second linear projection layer(s) of the first and second encoders 150, 160. The process 600 of FIG. 6 may be implemented by one or more computers in one or more locations; for convenience the process is also described with reference to the system of FIG. 5. The process 600 trains the denoising model 120 comprising a self-attention layer implementing an attention mechanism for applying attention over a training input token sequence 501. As noted above, in some implementations, the denoising model 120 comprises a diffusion model.

[0121] The process 600 may comprise a plurality of training iterations. Each training iteration involves processing a respective target video 512 of the training dataset 510. In some implementations, the one or more target videos 512 in the training dataset 510 represent a real-world environment. In other implementations, the method further comprises an initial step ofATTORNEY DOCKET NO. 45288-0665WO1generating a target video 512 and an associated input style image 513 for the training dataset 510 by processing natural language input, using a text-to-image model, to generate a target image and the input style image 513, where the target image and input style image 513 have the same style and depict different objects, and processing the target image, using an image-to-video model, to generate the target video 512.

[0122] At step 602, a training video 512 for the training iteration is obtained from the training dataset 510. In some implementations, the entire training video 512 serves as the generation target for the training process. In other implementations, the method comprises an optional step of extracting a temporal segment of the training video 512, referred to as a clip (e.g., target clip 531), to serve as the generation target. FIG. 7 illustrates an example training video timeline 700 demonstrating the extraction of such a segment. As illustrated, the extracted training clip 701 (corresponding to target clip 531) comprises a continuous sequence of frames between a start time T2and an end time T3.

[0123] In some implementations, the training dataset 510 may include a respective input style image 513 having the style of the training video 512, in these cases, step 602 may also involve obtaining this corresponding style image 513.

[0124] At step 604, the method comprises obtaining a second set of tokens representing a description of the training video 512. In implementations where the generation target is an extracted clip 531, 701, the tokens of the second set may represent a description specific to said clip rather than the entire training video 512. Such a description may be generated by processing the clip 531 (or the training video 512 when the entire the training video 512 is used as generation target) using a video-to-text model 540. The use of the video-to-text model 540 is generally optional, i.e. in other implementations, the description may be obtained in other ways e.g. from user input. Step 604 may further comprise obtaining a first set of tokens comprising a plurality of input visual tokens 103 (e.g., representing an initialized noise video or image) to be processed by the denoising model 120.

[0125] At step 606, the method comprises sampling one or more frames depicting an object directly from the training video 512 to serve as one or more input content images 532 (e.g., via the data extraction module 530). As shown in the timeline 700 of FIG. 7. when a clip 701 has been selected as the generation target, the input content images 702, 703 (corresponding to the input content images 532) are sampled from frames of the training video 512 that are not comprised in said clip 701. Specifically, a first sampled content image 702 may be extracted at a time 1 prior to the clip 701. and a second sampled content image 703 may be extracted at aATTORNEY DOCKET NO. 45288-0665WO1time T4after the clip 701. These input content images 532 may be randomly selected from the available frames of the training video 512 outside of the target generation area.

[0126] Referring back to the process 600 of FIG. 6, at step 608, the method comprises generating, using the first image encoder 150, a third set of tokens comprising a plurality of image tokens from the first content image 532, 702. When further input content images 532, 703 are sampled, the method may further comprise generating, for each further input content image, using the first image encoder 150, a respective further third set of tokens. As noted above, in some implementations, generating these tokens comprises processing the first input content image 532, 702, using the first image encoder 150, to generate an initial embedding of the first input content image, and processing the initial embedding using the above-described first linear projection layer to generate the final image tokens. Additionally, if an input style image 513 was obtained, the method may further comprise generating a fourth set of tokens comprising a plurality of image tokens representing the input style image 513 using an image encoder 160. This may involve generating an initial embedding of the input sty le image using the second image encoder 160 and processing initial embedding using the above-described second linear projection layer.

[0127] At step 610, the method comprises processing, using the denoising model 120, a training input token sequence 501 comprising the first, second, and third set(s) of tokens (and optionally the fourth set). The denoising model 120 may be configured to iteratively process the training input token sequence 501, and optionally one or more auxiliary tokens 104 representing a denoising time step, to generate output visual tokens for denoising the input visual tokens 103. At step 612, a plurality' of output visual tokens representing a target video 502 is generated.

[0128] At step 614, the method comprises updating parameters of the denoising model 120 (e.g., via updates 503 generated by the training engine 520) based on a comparison of the training video 512 and the target video 502. When comparing based on a clip 531, 701, the parameters may be updated based on a mean squared error loss of the clip 531, 701 of the training video 512 and the target video 502. In some implementations, updating parameters may comprise generating, using a video encoder, a plurality’ of video tokens from the training video 512 and comparing them to the output visual tokens representing the target video 502. Alternatively, the plurality' of output visual tokens may be processed using a neural network decoder 170 to generate the target video 502 in pixel space for comparison with the training video 512. Furthermore, in implementations where the first and / or second linear projectionATTORNEY DOCKET NO. 45288-0665WO1layers are utilized, parameters of the denoising model 120 and parameters of the first and / or second projection layer(s) may be updated jointly by the training engine 520.

[0129] While the training systems and methods of FIGS. 5 and 6 have been described above as generating a target video (e.g., utilizing a target clip as the generation target), in other implementations where the denoising model is trained to generate a target image, the generation target may instead be a single frame extracted from the training video. In such cases, the one or more input content images are sampled from frames of the training video that are distinct from this single target frame, and the parameters of the denoising model are updated based on a comparison of the generated target image and the single target frame.

[0130] Following the execution of process 600, the method may further comprise using the trained denoising model 120 for inference, i.e.. for generating a plurality of output visual tokens representing a target image or a target video 101 according to the techniques described with reference to FIG. 3.

[0131] FIG. 8 shows an example graphical user interface 800 for an image or video generation system configured to generate a target image or a target video 101 from multi-modal user input. The user interface 800 provides a designated input mechanism, such as the shown "Ingredients to Video” panel, that enables a user to explicitly separate and input discrete conditioning modalities.

[0132] The user interface 800 is configured to receive as user input a textual description 802 of the target image or the target video 101. To this end, the interface 800 may provide a text entry field 801 configured to receive the description 802 via a text input device (e.g., a keyboard) or speech-to-text input.

[0133] The user interface 800 may be further configured to receive as user input one or more input content images 803 depicting respective objects. In some implementations, the user interface 800 is further configured to receive an input sty le image 804 that defines a target style of the target image or the target video 101. As illustrated, the interface 800 may include one or more image upload or selection elements to receive these images 803, which are sometimes referred to as “assets” or “ingredients”. The user interface 800 may comprise designated regions for content assets and. in some implementations, a (separate) designated area for the input style image 804. In some implementations, the user interface 800 may be configured to allow a user to provide the input content images 803 and / or the input style image 804 via a drag-and-drop interaction, for example, by a user selecting one or more image files from a data storage location and dropping said files into said designated regions of the user interface 800.ATTORNEY DOCKET NO. 45288-0665WO1

[0134] By configuring the input in this manner, the interface 800 allows the user to directly set the multi-modal processing conditions for the underlying denoising model 120. This explicit separation of modalities overcomes the technical limitation of attempting to articulate complex, specific visual details (such as the identity of multiple distinct characters or specific artistic styles) solely through textual input. In some implementations, the image or video generation system is configured to generate the target image or the target video 101 according to the inference methods described with reference to FIG. 3.

[0135] While the techniques described above with reference to Figures 1 to 8 used a combination of text and image data as conditioning data, it is to be understood that in other implementations, the conditioning data may further comprise tokens representing other modalities, for example, audio and / or video data. An example system for processing such multi-modal reference data will now be described with reference to Figures 9 to 11.

[0136] FIG. 9 shows a variation of the computer system of FIG. 1. In broad terms, the computer system 900 is configured to use a denoising model 920 generate a target video natively comprising a synchronized audio track, referred to herein as a target video with audio 901. The computer system 900 is identical to the computer system 100 except that the system 900 is configured to receive and process additional modalities of conditioning data, specifically audio data 914 and video data 915. The audio data 914 may represent one or more input reference audio clips, and the video data 915 may represent one or more input reference videos.

[0137] The system 900 further comprises an audio encoder 950 and a video encoder 960. The audio encoder 950 is configured to process the audio data 914 to generate a fifth set of tokens comprising a respective plurality of audio tokens. Similarly, the video encoder 960 is configured to process the video data 915 to generate a sixth set of tokens comprising a plurality of video tokens. The generated fifth set of tokens and the sixth set of tokens are concatenated or otherwise combined with the visual tokens 103, text tokens 105 (generated by the text encoder 140 as described above), and any content or style image tokens 106, 107 to form the continuous input token sequence 902. By incorporating these additional token sets into the input token sequence 902, the self-attention layer of the denoising model 920 can attend globally to the audio and video conditioning data alongside the other modalities during the generation process.

[0138] In the example of FIG. 9, the text encoder 140 is show n receiving the natural language input 911 directly to generate the text tokens 105: however, it is to be understood that the optionally provided rewriter 130 described above with reference to FIG. 1 may also be used inATTORNEY DOCKET NO. 45288-0665WO1the system 900 to process the natural language input 911 and provide a modified description to the text encoder 140.

[0139] FIG. 10 illustrates an example input token sequence 902 generated by the system 900. Similar to the input token sequence 102 described above, the sequence 902 comprises the noisy input visual tokens 103, the text tokens 105, the auxiliary7tokens 104, the content image tokens 106, and optionally the style image tokens 107. Furthermore, the input token sequence 902 comprises the audio tokens 903 and the video tokens 904 appended to the continuous sequence. While FIG. 10 illustrates a specific sequential order for these token sub-sequences (e g., with the audio tokens 903 and video tokens 904 appended at the end), it is to be understood that the sequential order of the token sub-sequences within the input token sequence 902 can vary in other implementations.

[0140] Unlike the user input 110 of FIG. 1 , the user input 910 of FIG. 9 may comprise a natural language input 911 that includes one or more inline text tags. In general, an inline text tag is a text string having a predefined syntax or format (e.g., a specific character sequence, such as a term enclosed in angle brackets) embedded directly within the sequence of words of the textual description, allowing the tag to be parsed and recognized by the system. The purpose of the inline text tag is to explicitly associate a designated portion of the description (e.g., a specific character, object, or action) to a corresponding piece of conditioning data (e.g. a content image, a style image, input audio, or input video). Accordingly, the text tokens 105 may comprise tokens representing these inline text tags to preserve this explicit association within the latent space. FIG. 10 illustrates this explicit association via tags 905, 906, and 907. For example, a first tag 905 may explicitly link one or more text tokens to the first content image tokens 109. Similarly, a second tag 906 may explicitly link respective one or more text tokens to the audio tokens 903, and a third tag 907 may explicitly link respective one or more text tokens to the video tokens 904. Providing these tags within the natural language text encourages the selfattention mechanism of the denoising model 120 to directly cross-reference the tagged portion of the description with the corresponding encoded image, audio, or video tokens present in the input token sequence 902.

[0141] To generate the respective token sets, the video encoder 960 and audio encoder 950 may apply predefined processing constraints and formatting to the input data. For example, the video encoder 960 may be configured to process the input video data 915 such that the resulting reference video latents (w hich comprise, or are mapped to, the plurality of video tokens) match the spatial resolution of the target video with audio 901 and have a fixed frame count (e.g.. 72 frames). The video encoder 960 may further downsample these frames into a smaller, fixedATTORNEY DOCKET NO. 45288-0665WO1number of reference video latent frames (e.g.. 9 latent frames). To maintain temporal consistency, the system 900 may synchronize the reference video latents by utilizing the target framerate of the target video with audio 901 to synthetically generate timesteps for each reference latent frame. The audio encoder 950 may be configured to process the input audio data 914 in fixed-duration segments (e.g., 3-second chunks).

[0142] The denoising model 920 is generally identical to the above-described denoising model 120, except that the denoising model 920 is configured to i) receive input token sequences that include conditioning data which comprise, inter alia, audio and / or video tokens and ii) generate output tokens that collectively represent a target video and associated audio. More specifically, the denoising model 920 may, using an iterative denoising process, process the input token sequence to generate output tokens representing the target video with audio 901. To this end, the denoising model may be configured to generate a joint output sequence comprising a plurality of output visual tokens and a plurality of output audio tokens (jointly representing the target video with audio 901). In other implementations, the denoising model may be configured to generate a plurality of output audiovisual tokens, wherein each audiovisual token comprises ajoint latent representation encoding both visual and acoustic features. The decoder 970 (which may comprise respective video and audio decoding components) processes these output tokens to generate the target video 901. Unlike the target video 101 of FIG. 1, the target video with audio 901 generated by the system 900 natively includes a synchronized audio track (e.g., dialogue, sound effects, or background music) decoded directly from the generated audio or audiovisual tokens. Because the denoising model 920 applied self-attention globally to the explicit tags (e.g., tags 906, 907) and the corresponding encoded audio and video tokens 903, 904 during the generation sequence, the resulting target video with video 901 and its synchronized audio track accurately reflect the specific acoustic features (e.g., a specific character's voice) and spatiotemporal characteristics requested by the user input 910.

[0143] When the input token sequence comprises a sixth set of tokens representing a reference video, the denoising model 920 may apply positional encoding in the same manner as the first set of tokens (i.e., the target video tokens). Specifically, each video token of the sixth set may comprise a latent representation of a patch and an associated positional embedding (e.g., a three-dimensional relative positional embedding or RoPE) representing its spatial coordinates within a frame and its synthetic temporal position among the latent frames. This ensures that the self-attention mechanism treats the spatiotemporal structure of the reference video with the same geometric consistency as the target video being generated.ATTORNEY DOCKET NO. 45288-0665WO1

[0144] FIG. 11 shows a variation of the computer system of FIG. 5. The training system 1100 is generally identical to the training system 500 except that the system 1100 is configured to train a denoising model (e.g., the denoising model 920) to generate a target video with audio 901 from conditioning data comprising a plurality of modalities, including audio data and / or video data. In this embodiment, the training dataset 1110 comprises a plurality' of training items 1111 that each comprise a respective training video, a respective style image, and a respective transcript of the corresponding training video. The transcripts (e.g.. Transcript 1, Transcript 2) may comprise speaker-aware transcripts that identify specific speaker utterances and corresponding timing information within the associated training video.

[0145] Similar to the clip-based training approach described with respect to FIG. 5, the training system 1100 comprises a data extraction module 1130 configured to obtain, from the training video of a training item 1111, i) a training clip (i . e. , a generation target) and ii) conditioning data comprising text, image, audio and video data to condition the denoising model 920. In broad terms, the data extraction module 1130 may be configured to implement a neighbourhood sampling strategy to identify the conditioning data, wherein reference candidates (e.g., audio segments or video frames) are sampled from a temporal neighbourhood within the training video that is mutually exclusive to the temporal segment defined as the training clip. In general, the data extraction module 1130 is configured to extract the conditioning data (e.g., content image(s), reference video data, and reference audio data) from portions of the training video that are temporally distant from the training clip. For example, the data extraction module 1130 may extract reference data from portions of the training video occurring outside the temporal boundaries of the training clip.

[0146] To extract reference video data, the data extraction module 1130 may extract one or more video reference clips from the training video (excluding the portion of the training video that corresponds to the training clip). In some implementations, the data extraction module 1130 extracts video reference clips having a predefined number of frames (e.g., 72 frames) which are then downsampled by a video encoder 960 to a smaller number of reference video latent frames (e.g., 9 latent frames). To maintain temporal alignment, the data extraction module 1130 may synchronize the reference video data by borrowing a framerate from the training clip to synthetically generate timesteps for each reference latent frame.

[0147] To extract reference audio data, the data extraction module 1130 may utilize the speaker-aware transcripts to identify speaker utterances within the training clip. The data extraction module 1130 may compute vocal embeddings, such as s4 embeddings, for the speaker utterances identified by the transcript to establish a vocal identity for each speaker. TheATTORNEY DOCKET NO. 45288-0665WO1data extraction module 1130 may then identify matching reference audio data from other portions of the training video (e.g.. the portion of the video occurring after the training clip) by comparing the embeddings of candidate segments to the vocal identities established from the training clip. In some implementations, this comparison may involve calculating a similarity metric or distance metric (e.g., cosine similarity) between the respective embeddings in a multidimensional s4 space to determine if a candidate segment matches an established vocal identify. When selecting from multiple candidate segments, the system may prioritize matching reference audio data that are temporally distant from the training clip and may further prioritize the selection of reference data for different speakers identified in the training clip to ensure a diverse representation of vocal identities. For non-speech reference audio data, the data extraction module 1130 may identify matches by determining if at least one common audio class is present in both a candidate segment and the training clip with a high probability as determined by a classifier. By way of example, the classifier may be configured to identify predefined non-speech audio classes such as dog barking, siren, applause, or rain. To enhance model robustness, the data extraction module 1130 may apply one or more predefined acoustic distortions to the extracted audio references. These distortions may include denoising, dereverberation, clipping, altering volume or gain, or adding background sounds, music, or reverb.

[0148] The extracted audio and video references are then processed by the respective audio encoder 950 and video encoder 960 to provide the multimodal tokens for the training input token sequence 1102. The denoising model 920 then processes the training input token sequence 1102 to generate corresponding output tokens. The training engine 1120 then updates the parameters of the denoising model 920 based on a comparison of the generated target video with audio and the original corresponding segment of the training video and its associated audio. In some implementations, this comparison may be performed in a pixel space, a latent space, or a combination thereof, to determine a reconstruction error (e.g., a loss) used to optimize the denoising model 920. In some implementations, the first and / or second projection layers of the image encoders 150, 160 may be trained jointly with the denoising model 920 (as described for FIG. 5).

[0149] In some implementations, the data extraction module 1130 may be further configured to generate one or more inline text tags and insert them into the description of the training clip (to facilitate the learning of cross-modal associations). Specifically, the data extraction module 1130 may embed these tags (in an automated rather than manual manner) at designated positions within the description based on metadata and analysis performed during theATTORNEY DOCKET NO. 45288-0665WO1extraction process. For image or video tags, the data extraction module 1130 may employ a trained object detection model (e.g., a person or object detector) to identify certain subjects or objects in both the training clip and the corresponding sampled content images or reference video clips. For audio tags, the data extraction module 1130 may utilize timing and identity metadata provided by speaker-aware transcripts and similarity metrics. For example, when the data extraction module 1130 identifies a matched entity across modalities, it generates a corresponding tag (e.g.. <image_0> or <audio_0>) and inserts it adjacent to the tokens representing that entity in the description. By generating both the multimodal tokens and the associating tags, the data extraction module 1130 constructs a training input token sequence 1102 that allows the self-attention mechanism of the denoising model 920 to leam explicit mappings between textual entities and their acoustic or spatiotemporal counterparts.

[0150] While the embodiments of FIGS. 9-11 have been described as using, as part of the conditioning input, both i) one or more content image(s) (and optionally a style image) and ii) audio and / or video input, other embodiments are envisaged in which the conditioning data comprises the textual description and the audio and / or video input, without strictly requiring the image inputs (although they may optionally be provided). In such implementations, the input token sequence may comprise the above-described first set of tokens (noisy input visual tokens), the above-described second set of tokens (text tokens), and the above-described fifth set of tokens (audio tokens) and / or the above-described sixth set of tokens (video tokens). Either or both of the third set of tokens (content image tokens) and the fourth set of tokens (style image tokens) may be omitted. Aside from the omission of the third and / or fourth sets of tokens, these embodiments may be otherwise identical in architecture, operation, and training to the systems and methods described above with reference to FIGS. 9-11. This configuration allows, for example, the system to generate a target video guided by the textual description and the acoustic or spatiotemporal characteristics of the provided audio or video references, with or without reliance on static visual references. For example, a user may provide a textual description of a scene along with a reference audio clip of a specific character’s voice or a reference video depicting a specific gait, and the denoising model may process the corresponding continuous token sequence to generate a target video that incorporates the requested action and natively synchronizes with the acoustic features.

[0151] The above-described techniques may be applied to a wide range of applications. As one example, the system may be utilized for virtual try-on applications, wherein a first input content image depicts a specific garment and a second input content image depicts a specific character, allowing the system to generate a video of the character wearing the garment while maintainingATTORNEY DOCKET NO. 45288-0665WO1the character's visual continuity. Additionally, the system may be used for product recontextualization, wherein a specific product provided as an input content image is placed into novel scenes or scenarios described by the textual description. Furthermore, the system may be utilized for scene building by using multiple reference images corresponding to different scene elements to construct a desired visual environment.

[0152] As another example, the system may be utilized for generating predictive visual models of real-world environments to facilitate the autonomous control of physical systems. For instance, in robotics applications, when the input content images are images of a real-world environment (e.g., captured by a camera), the generated target image or target video may represent a prediction of that real-world environment over a future time period. The system may further comprise processing the target image or the target video to generate control data to control a mechanical agent (e.g., a physical robot) in accordance with the generated target image or video to perform a task. Generating the control data may comprise, for example, applying computer vision techniques or a trained extraction model to the target video to extract specific spatial coordinates, trajectory paths, or joint angles corresponding to the mechanical agent’s predicted movements. For instance, the target video may depict the mechanical agent performing a task specified by the textual description and the content images. A control system may then use this visual prediction, for example using model predictive control, to generate physical control signals for mechanical agent for navigating or moving objects within the environment.

[0153] Further possible implementation details of the denoising model will now be described. As described above, the denoising model may operate on latent representations generated by an autoencoder framework. It is to be understood that this autoencoder framework (which maps pixel data into the latent space and back into pixel space) may be distinct from the image encoder used to generate the conditioning image tokens representing the input content images or input style images. In some implementations, the autoencoder framework comprises a fully convolutional architecture (e.g., comprising 2D convolutions in space and ID convolutions in time) without attention layers (whereas the denoising model utilized in the latent space comprises one or more self-attention layers). The locality of the convolutional layers allows for encoding almost any resolution and number of frames, provided the input resolution in each dimension is evenly divisible by 2Kwhere K is the number of upsampling steps of that dimension. In some implementations, the encoder of this autoencoder framew ork employs a latent bottleneck penalty to constrain latent variables to a predefined range (e.g., [-1. 1]). This bottleneck is designed to simulate pixel diffusion representation without requiring the hyper-ATTORNEY DOCKET NO. 45288-0665WO1parameter tuning typically associated with vector quantization or KL regularization. This penalty may comprise a max margin penalty applied to a linear output layer of the autoencoder's encoder, formulated as S(max(|x| —Furthermore, the autoencoder framework may be trained using a combination of losses, including an L2 reconstruction loss, a learned perceptual image patch similarity (LPIPs) loss, and an adversarial loss utilizing a DINO-based discriminator network. To stabilize adversarial training, gradients of the discriminator outputs with respect to its inputs may be penalized. Additionally, the self-attention mechanisms of the denoising model may be applied without a causal mask, enabling video tokens to attend bidirectionally to all other video and conditioning tokens in the sequence.

[0154] When a cascaded decoding architecture is utilized, the secondary denoising model (e.g., a latent-to-latent diffusion model) may employ a UVIT architecture comprising multiple downsampling stages utilizing Haar resampling. In a spatial 2X upsampling setting, the latent-to-latent diffusion model may be configured to perform a 64X tensor scaling task. Transformer blocks within this architecture may utilize splash self-attention with three-dimensional relative positional encoding and local windows. A scalar diffusion time conditioning signal may be fed into every block of this architecture through Feature-wise Linear Modulation (FiLM). Additionally, training the latent-to-latent diffusion model may involve noise augmentation following a forward diffusion process with a cosine schedule (e.g., cos(nt / 2)x0+ sin(irt / 2)s) to mitigate texture sticking and improve sample quality.

[0155] In some implementations, the system may further compnse a video-to-audio model configured to generate synchronized soundtracks (e.g., sound effects, background music, or dialogue) for the generated target video. The video-to-audio model may employ a two-stage diffusion process, utilizing a base diffusion model to generate a lo -resolution log-mel spectrogram (e.g., generated from 24 kHz stereo audio) conditioned on generated video frames and text prompts, and an upsampling diffusion model to generate a full -resolution log-mel spectrogram. To ensure precise audio-visual synchronization, video embeddings derived from video frames centre-cropped to a predefined resolution (e g., 256x256 pixels at 24 fps) are aligned with noisy spectrogram features along the time axis and summed in a first layer of the model's U-Net architecture . Spatial features of the video frames may be extracted using a contrastive vision-language model (e.g., ALIGN) and an NFNet model. The full-resolution spectrogram may then be converted into an audio w aveform using an algorithm such as Griffin-Lim or a trained neural audio codec vocoder (e.g., SoundStream).ATTORNEY DOCKET NO. 45288-0665WO1

[0156] As noted above, the denoising model 120, 920 may be a diffusion model. Examples of suitable diffusion models include latent diffusion models, which operate in a latent space rather than directly in a pixel space. The latent diffusion neural network performs a diffusion process in latent space, e.g., in a latent space that is lower-dimensional than the output space. That is, the data items (“representations”) operated on by the diffusion neural network are latent representations and the values in the representations are learned, latent values, e.g., rather than colour values when the data items are images. In general, diffusion models, such as latent diffusion models, generate video / images by using a noise removal process. The denoising neural network is trained to estimate the level of noise in an input. After training the denoising neural network, a system can perform a reverse diffusion process using the denoising neural network to generate a new set of data, e.g., a new video / image latent.

[0157] To perform the reverse diffusion process, the system can, in some examples, receive a conditioning input, such as text input or a latent representation. The system can then initialize a representation of a new video / image by sampling noise values from a noise distribution. The system can then update the representation of the new image at each of a plurality of reverse diffusion steps. As part of the updating, at each reverse diffusion step, the system processes a denoising input for the reverse diffusion step that includes the representation of the new data being generated (e.g., a video latent) using the denoising neural network, optionally conditioned on the conditioning input, to generate a denoising output that defines an estimate of a noise component of the representation of the new data.

[0158] Optionally, the system can use classifier-free guidance at each reverse diffusion step. When using classifier-free guidance, the system processes another denoising input for the reverse diffusion step that includes the representation of the new data using the denoising neural network but not conditioned on the conditioning input to generate another denoising output. The system then combines the conditional and unconditional denoising outputs in accordance with a guidance weight for the reverse diffusion step to generate a final denoising output.

[0159] At each reverse diffusion step, the system then updates the representation of the new data using the denoising output. For example, the system can determine an initial estimate of the final data using the denoising output and then apply an appropriate diffusion sampler, e.g., the DDPM (Denoising Diffusion Probabilistic Model) sampler, the DDIM (Denoising Diffusion Implicit Model) sampler or another appropriate sampler, to the initial estimate to update the cunent representation. At the last reverse diffusion step, the system can use the initial estimate as the updated representation.ATTORNEY DOCKET NO. 45288-0665WO1

[0160] After updating the representation of the new data at each of the plurality of reverse diffusion steps, the system generates the new data from the representation of the new data. As described above, each denoising output defines an estimate of a noise component of the corresponding representation of the corresponding data. The denoising output can define this estimate in any of a variety of ways.

[0161] In some implementations, the denoising output is an estimate of the noise component of the current representation, i.e., the noise that needs to be combined with, e.g., added to or subtracted to, a final representation to generate the current representation.

[0162] In some other implementations, the denoising output is an estimate of the final representation given the current representation, i.e., an estimate of the representation that would result from removing the noise component of the current representation.

[0163] In some other implementations, the denoising output defines a predicted residual between the true noise component of the current representation and an analytic estimate of the noise component, i.e., an estimate that has been computed analytically from the current representation.

[0164] In some other implementations, the denoising output is a v-parametrization of the estimate of the noise component. When the representations are in a latent space, the system can generate the restored video / image in the output space by processing the final representation in the latent space using a decoder neural network (e g. decoder 170), e.g.. one that has been pretrained in an auto-encoder framework with an encoder neural network (e.g., an image encoder or a video encoder). During training, the system can use an encoder neural network, e.g., one that has been pre-trained jointly with the decoder in the auto-encoder framework, to encode training videos / images in the output space to generate target representations for the diffusion neural network in the latent space.

[0165] The diffusion neural network can be any appropriate diffusion neural network that is configured to receive an input that includes a current (noisy) representation of an image / video latent and, optionally, a conditioning input and to generate a denoising output.

[0166] In some implementations, during training, the diffusion neural network can be associated with an encoder to encode training data items into the latent space and, after training and to generate new output data items, a decoder neural network (e.g. decoder 170) that receives an input that includes a latent representation of a data item and decodes the latent representation to reconstruct the data item.

[0167] As noted above, in some implementations, the denoising model (e.g., denoising model 120 or 920) may be implemented as a token generation neural network configured to generateATTORNEY DOCKET NO. 45288-0665WO1an output sequence of multimodal tokens. Generating the output sequence may comprise, at a particular position in the sequence, performing one or more parallel denoising steps to generate a sequence of latent tokens representing a media item (e.g., an image, video, or audio item). This sequence of latent tokens may comprise the above-described output visual tokens. While the network updates all latent tokens in parallel during a denoising step, at other positions in the sequence, the network may autoregressively generate discrete multimodal tokens (e g., text tokens) conditioned on preceding tokens in the sequence.

[0168] Once the sequence of latent tokens is generated, the system may generate the output media item (e.g., pixel data or an audio waveform) by processing the latent tokens using a media item decoder neural network. To represent this generated media item within the output sequence for further processing (e.g., for responding to queries or generating additional items), the system may append two token sequences to the output sequence starting at the particular position: (i) a sequence of media item generation tokens derived from the latent tokens and (ii) a sequence of media item understanding tokens representing the output media item. The sequence of media item understanding tokens is generated by processing the output media item using a media item encoder.

[0169] The media item generation tokens and media item understanding tokens represent distinct properties of the media item. The generation tokens represent properties required to accurately reconstruct the media item. The understanding tokens represent properties of the content of the media item, such as semantic properties, required to perform media item understanding tasks. For an image, such understanding tasks include image classification, object detection, image segmentation, image captioning, and visual question answering. This dual-token representation allows the token generation neural network to continue generating further multimodal tokens in the continuous sequence conditioned on the generated media item.

[0170] The token generation neural network may utilize an asymmetric self-attention mechanism (to facilitate this hybrid generation approach). In this mechanism, one or more selfattention layers perform causal attention over text tokens and media item understanding tokens, ensuring these tokens only attend to themselves and preceding tokens in the sequence. The same self-attention layers perform bi-directional attention over media item generation tokens and latent tokens, so that each generation or latent token attends to itself and every other generation or latent token for that media item during the denoising and reconstruction process.

[0171] Accordingly, when the user input comprises an input media item, the second, third, fourth, fifth, or sixth sets of tokens representing that input media item (e.g., text, image, audio, video inputs) may each comprise sub-sequences of these media item understanding andATTORNEY DOCKET NO. 45288-0665WO1generation tokens. Similarly, after generating the output media item using the latent tokens, the token generation neural network may append a sequence of media item generation tokens and the corresponding sequence of media item understanding tokens to the output sequence. This ensures a consistent representation of media items throughout the continuous multimodal sequence.

[0172] Further in these implementations, the token generation neural network may comprise an input projection subnetwork, a core subnetwork (comprising the self-attention layers), and an output projection subnetwork. The input and output projection subnetworks may each comprise only a single linear projection layer configured to project tokens between the latent embedding space and the core subnetwork’s multimodal embedding space.

[0173] Furthermore, when training the token generation neural network, the system may implement a generation token dropout strategy. That is, during training, the system may determine, with a certain probability, whether to drop out media item generation tokens from a training input sequence. In response to determining to drop out the tokens, the training sequence is generated to include media item understanding tokens representing a respective training media item but not the corresponding media item generation tokens. This forces the network to learn to generate media items based on semantic understanding tokens, thereby improving in-context composition and reasoning.

[0174] In this specification, the term “configured’’ is used in relation to computing systems and environments, as well as computer program components. A computing system or environment is considered "configured" to perform specific operations or actions when it possesses the necessary software, firmware, hardware, or a combination thereof, enabling it to carry out those operations or actions during operation. For instance, configuring a system might involve installing a software library’ with specific algorithms, updating firmware with new instructions for handling data, or adding a hardware component for enhanced processing capabilities. Similarly, one or more computer programs are "configured" to perform particular operations or actions when they contain instructions that, upon execution by a computing device or hardware, cause the device to perform those intended operations or actions.

[0175] The embodiments and functional operations described in this specification can be implemented in various forms, including digital electronic circuitry', software, firmware, computer hardware (encompassing the disclosed structures and their structural equivalents), or any combination thereof. The subject matter can be realized as one or more computer programs, essentially modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by or to control the operation of a computing device or hardware.ATTORNEY DOCKET NO. 45288-0665WO1The storage medium can be a storage device such as a hard drive or solid-state drive (SSD), a storage medium, a random or serial access memory device, or a combination of these. Additionally or alternatively, the program instructions can be encoded on a transmitted signal, such as a machine-generated electrical, optical, or electromagnetic signal, designed to carry information for transmission to a receiving device or system for execution by a computing device or hardware. Furthermore, implementations may leverage emerging technologies like quantum computing or neuromorphic computing for specific applications, and may be deployed in distributed or cloud-based environments where components reside on different machines or within a cloud infrastructure.

[0176] The term "computing device or hardware" refers to the physical components involved in data processing and encompasses all types of devices and machines used for this purpose. Examples include processors or processing units, computers, multiple processors or computers working together, graphics processing units (GPUs), tensor processing units (TPUs), and specialized processing hardware such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs). In addition to hardware, a computing device or hardware may also include code that creates an execution environment for computer programs. This code can take the form of processor firmware, a protocol stack, a database management system, an operating system, or a combination of these elements. Embodiments may particularly benefit from utilizing the parallel processing capabilities of GPUs, in a General-Purpose computing on Graphics Processing Units (GPGPU) context, where code specifically designed for GPU execution, often called kernels or shaders, is employed. Similarly, TPUs excel at running optimized tensor operations crucial for many machine learning algorithms. By leveraging these accelerators and their specialized programming models, the system can achieve significant speedups and efficiency gains for tasks involving artificial intelligence and machine learning, particularly in areas such as computer vision, natural language processing, and robotics.

[0177] A computer program, also referred to as software, an application, a module, a script, code, or simply a program, can be written in any programming language, including compiled or interpreted languages, and declarative or procedural languages. It can be deployed in various forms, such as a standalone program, a module, a component, a subroutine, or any other unit suitable for use within a computing environment. A program may or may not correspond to a single file in a file system and can be stored in various ways. This includes being embedded within a file containing other programs or data (e.g., scripts within a markup language document), residing in a dedicated file, or distributed across multiple coordinated files (e.g..ATTORNEY DOCKET NO. 45288-0665WO1files storing modules, subprograms, or code segments). A computer program can be executed on a single computer or across multiple computers, whether located at a single site or distributed across multiple sites and interconnected through a data communication network. The specific implementation of the computer programs may involve a combination of traditional programming languages and specialized languages or libraries designed for GPGPU programming or TPU utilization, depending on the chosen hardware platform and desired performance characteristics.

[0178] In this specification, the term "engine" broadly refers to a software-based system, subsystem, or process designed to perform one or more specific functions. An engine is typically implemented as one or more software modules or components installed on one or more computers, which can be located at a single site or distributed across multiple locations. In some instances, one or more dedicated computers may be used for a particular engine, while in other cases, multiple engines may operate concurrently on the same one or more computers. Examples of engine functions within the context of Al and machine learning could include data pre-processing and cleaning, feature engineering and extraction, model training and optimization, inference and prediction generation, and post-processing of results. The specific design and implementation of engines will depend on the overall architecture and the distribution of computational tasks across various hardware components, including CPUs, GPUs, TPUs, and other specialized processors.

[0179] The processes and logic flows described in this specification can be executed by one or more programmable computers running one or more computer programs to perform functions by operating on input data and generating output. Additionally, graphics processing units (GPUs) and tensor processing units (TPUs) can be utilized to enable concurrent execution of aspects of these processes and logic flows, significantly accelerating performance. This approach offers significant advantages for computationally intensive tasks often found in Al and machine learning applications, such as matrix multiplications, convolutions, and other operations that exhibit a high degree of parallelism. By leveraging the parallel processing capabilities of GPUs and TPUs, significant speedups and efficiency gains compared to relying solely on CPUs can be achieved. Alternatively or in combination with programmable computers and specialized processors, these processes and logic flows can also be implemented using specialized processing hardware, such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), for even greater performance or energy efficiency in specific use cases.ATTORNEY DOCKET NO. 45288-0665WO1

[0180] Computers capable of executing a computer program can be based on general-purpose microprocessors, special-purpose microprocessors, or a combination of both. They can also utilize any other type of central processing unit (CPU). Additionally, graphics processing units (GPUs), tensor processing units (TPUs), and other machine learning accelerators can be employed to enhance performance, particularly for tasks involving artificial intelligence and machine learning. These accelerators often work in conjunction with CPUs, handling specialized computations while the CPU manages overall system operations and other tasks. Typically, a CPU receives instructions and data from read-only memory (ROM), random access memory (RAM), or both. The essential elements of a computer include a CPU for executing instructions and one or more memory devices for storing instructions and data. The specific configuration of processing units and memory will depend on factors like the complexity of the Al model, the volume of data being processed, and the desired performance and latency requirements. Embodiments can be implemented on a wide range of computing platforms, from small embedded devices with limited resources to large-scale data center systems with high-performance computing capabilities. The system may include storage devices like hard drives, SSDs, or flash memory for persistent data storage.

[0181] Computer-readable media suitable for storing computer program instructions and data encompass all forms of non-volatile memory, media, and memory' devices. Examples include semiconductor memory' devices such as read-only memory (ROM), solid-state drives (SSDs), and flash memory devices; hard disk drives (EIDDs); optical media; and optical discs such as CDs, DVDs, and Blu-ray discs. The specific type of computer-readable media used will depend on factors such as the size of the data, access speed requirements, cost considerations, and the desired level of portability or permanence.

[0182] To facilitate user interaction, embodiments of the subject matter described in this specification can be implemented on a computing device equipped with a display device, such as a liquid crystal display (LCD) or an organic light-emitting diode (OLED) display, for presenting information to the user. Input can be provided by the user through various means, including a keyboard), touchscreens, voice commands, gesture recognition, or other input modalities depending on the specific device and application. Additional input methods can include acoustic, speech, or tactile input, while feedback to the user can take the form of visual, auditory, or tactile feedback. Furthermore, computers can interact with users by exchanging documents with a user's device or application. This can involve sending web content or data in response to requests or sending and receiving text messages or other forms of messages throughATTORNEY DOCKET NO. 45288-0665WO1mobile devices or messaging platforms. The selection of input and output modalities will depend on the specific application and the desired form of user interaction.

[0183] Machine learning models can be implemented and deployed using machine learning frameworks, such as TensorFlow or JAX. These frameworks offer comprehensive tools and libraries that facilitate the development, training, and deployment of machine learning models.

[0184] Embodiments of the subject matter described in this specification can be implemented within a computing system comprising one or more components, depending on the specific application and requirements. These may include a back-end component, such as a back-end server or cloud-based infrastructure; an optional middleware component, such as a middleware server or application programming interface (API), to facilitate communication and data exchange; and a front-end component, such as a client device with a user interface, a web browser, or an app, through which a user can interact with the implemented subject matter. For instance, the described functionality could be implemented solely on a client device (e.g., for on-device machine learning) or deployed as a combination of front-end and back-end components for more complex applications. These components, when present, can be interconnected using any form or medium of digital data communication, such as a communication network like a local area network (LAN) or a wide area network (WAN) including the Internet. The specific system architecture and choice of components will depend on factors such as the scale of the application, the need for real-time processing, data security requirements, and the desired user experience.

[0185] The computing system can include clients and servers that may be geographically separated and interact through a communication network. The specific type of network, such as a local area network (LAN), a wide area network (WAN), or the Internet, will depend on the reach and scale of the application. The client-server relationship is established through computer programs running on the respective computers and designed to communicate with each other using appropriate protocols. These protocols may include HTTP, TCP / IP, or other specialized protocols depending on the nature of the data being exchanged and the security requirements of the system. In certain embodiments, a server transmits data or instructions to a user's device, such as a computer, smartphone, or tablet, acting as a client. The client device can then process the received information, display results to the user, and potentially send data or feedback back to the server for further processing or storage. This allows for dynamic interactions between the user and the system, enabling a wide range of applications and functionalities.ATTORNEY DOCKET NO. 45288-0665WO1

[0186] While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

[0187] Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0188] Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.

[0189] What is claimed is:

Claims

ATTORNEY DOCKET NO. 45288-0665WO1CLAIMS1. A computer-implemented method for generating a plurality of output visual tokens representing a target image or a target video, the method comprising:obtaining an input token sequence comprising a series of successive token subsequences, the token sub-sequences comprising, respectively, a first set of tokens, a second set of tokens, and at least one third set of tokens;the first set of tokens comprising a plurality of input visual tokens, the second set of tokens comprising a plurality of tokens representing a description of the target image or the target video, and the third set of tokens comprising a plurality of image tokens representing a first input content image depicting an object;processing, using a denoising model, the input token sequence to generate a plurality of output visual tokens representing the target image or the target video,wherein the denoising model comprises a self-attention layer implementing a selfattention mechanism, andwherein processing the input token sequence comprises applying self-attention over the series of successive token sub-sequences of the input token sequence, using the self-attention mechanism, to generate the plurality of output visual tokens.

2. The method of claim 1. wherein the input token sequence further comprises a plurality of third sets of tokens, the plurality of third sets of tokens representing, respectively, the first input content image and one or more further input content images, each third set of tokens comprising a respective plurality of image tokens, each further input content image depicting a respective object.

3. The method of claim 1 or 2, wherein the input token sequence further comprises a token sub-sequence comprising a fourth set of tokens, the fourth set of tokens comprising a plurality of image tokens representing an input style image that defines a target sty le of the target image or the target video, in particular wherein the denoising model has been trained using a plurality of corresponding input token sequences that respectively comprise fourth sets of tokens that represent images of different objects in the same style.ATTORNEY DOCKET NO. 45288-0665WO14. The method of any preceding claim further comprising generating, using a text encoder, the plurality of tokens of the second set of tokens from natural language input comprising the description of the target image or the target video.

5. The method of claim 4, wherein the natural language input comprises an initial description of the target image or the target video, and generating the plurality of tokens further comprises:processing each of the input content images and optionally the input style image, using an image-to-text model, to obtain, for each input image a respective plurality of tokens representing a caption of the corresponding image; andgenerating the tokens of the second set of tokens based on the plurality of tokens for the initial description of the target image or the target video, and the generated tokens representing captions of the input images.

6. The method of claim 5, wherein the plurality of tokens of the second set of tokens comprises the plurality of tokens representing the initial description of the target image or the target video, and the generated tokens representing the captions of the input images.

7. The method of claim 5, wherein generating the tokens of the second set of tokens based on the plurality of tokens for the initial description of the target image or the target video, and the generated tokens representing captions of the input images comprises:processing the plurality' of tokens representing the initial description of the target image or the target video and the generated tokens representing the captions of the input images, using a text-to-text model, to generate a plurality of tokens representing a modified description of the target image or the target video; andgenerating the tokens of the second set of tokens based on the tokens representing the modified description.

8. The method of any preceding claim, wherein the input token sequence further comprises a quality score token indicative of a target quality for the target image or the target video.

9. The method of any preceding claim, wherein the method further comprises:generating, using an image encoder, the plurality of image tokens of the third set of tokens from the first input content image.ATTORNEY DOCKET NO. 45288-0665WO110. The method of claim 9, wherein generating, using an image encoder, the plurality of image tokens of the third set of tokens from the first input content image further comprises:processing the first input content image, using the image encoder, to generate an initial embedding of the first input content image;processing the initial embedding of the first input content image, using a first trained linear projection layer to generate the plurality of image tokens of the third set of tokens.

11. The method of any of claims 3-10 when dependent on claim 3, wherein the method further comprises:generating, using a or the image encoder, the plurality of image tokens of the fourth set of tokens from the input style image.

12. The method of claim 11, wherein generating, using an image encoder, the plurality of image tokens of the fourth set of tokens from the input style image further comprises:processing the input style image, using the image encoder, to generate an initial embedding of the input style image;processing the initial embedding of the input style image, using a second trained linear projection layer to generate the plurality of input image tokens for the input style image.

13. The method of any preceding claim further comprising processing the plurality of output visual tokens, using a neural network decoder, to generate image or video data for the target image or the target video.

14. The method of any preceding claim, wherein the denoising model comprises a plurality of transformer layers comprising a plurality of the self-attention layers, and wherein:one or more of the transformer layers are global transformer layers that attend to all tokens in a respective input sequence of tokens; andone or more of the transformer layers are local transformer layers thatattend to a sliding window of tokens in a respective input sequence of tokens.

15. The method of claim 14 wherein one of the transformer layers implements said selfattention layer implementing an attention mechanism for applying attention across the input token sequence.ATTORNEY DOCKET NO. 45288-0665WO116. The method of any preceding claim, when the plurality of output visual tokens represent a target video, wherein, each input visual token comprises a latent representation of a respective one or more pixels of a patch of the input video and an input positional embedding representing a spatial and temporal position of the one or more pixels of the patch of the input video.

17. The method of claim 16, wherein the input positional embedding is a relative positional embedding.

18. The method of any of claims 2-17 when dependent on claim 2, wherein each image token of each third set of tokens generated from the input content image comprises a latent representation of a respective one or more pixels of a patch of the input content image and a content positional embedding comprising, for each image token of each third set of tokens, a label embedding representing a label for the corresponding input content image.

19. The method of claim 18 when dependent on claim 17,wherein the relative positional embedding comprises a representation of a two-dimensional position of the patch of the input video in a frame of the input video, and a representation of a position of the frame in time;wherein the label comprises an index of the input content image, wherein the content positional embedding comprises a representation of a two-dimensional position of the patch of the input content image, and a representation of the index of the input content image;the method further comprising:encoding in the input to the self-attention layer i) the relative positional embedding of each input video token and ii) the content positional embedding of each image token of each third set of tokens, wherein the encoding comprises encoding the relative positional embedding and the content positional embedding as respective vector rotations using one or more rotation matrices.

20. The method of any preceding claim, wherein the input content image is an image of a real-world environment.

21. The method of any preceding claim, wherein the target image or the target video represents the real-world.ATTORNEY DOCKET NO. 45288-0665WO122. The method of claim 21, when the plurality of output visual tokens represents a target video, wherein the target video represents a prediction of the real-world over a future time period.

23. The method of claim 21 or 22, further comprising processing the target image or target video to generate control data to control a mechanical agent in accordance with the target image or target video to perform a task.

24. The method of any preceding claim, wherein the input token sequence further comprises a fifth set of tokens comprising a respective plurality of audio tokens representing respective input reference audio data.

25. The method of any preceding claim, wherein the input token sequence further comprises a sixth set of tokens comprising a plurali ty of video tokens representing input reference video data.

26. The method of any preceding claim, wherein the description comprises one or more inline text tags, each inline text tag associating a designated portion of the description with a respective input content image, input reference audio data, or input reference video data, and wherein the plurality of tokens of the second set of tokens comprises tokens representing the one or more inline text tags.

27. A computer-implemented method for training a denoising model comprising a selfattention layer implementing an attention mechanism for applying attention over an input token sequence, the method comprising, for each of one or more training videos in a training dataset:obtaining a first set of tokens comprising a plurality of input visual tokens; obtaining a second set of tokens comprising a plurality of tokens representing a description of the training video:sampling, as a first input content image, a frame depicting an object from the training video;generating, using an image encoder, a third set of tokens comprising a plurality of image tokens, from the first content image;ATTORNEY DOCKET NO. 45288-0665WO1processing, using the denoising model, an input token sequence comprising the first, second and third set of tokens, to generate a plurality of output visual tokens representing a target video; andupdating parameters of the denoising model based on a comparison of the target video and the training video.

28. The method of claim 27 further comprising:sampling, as respective further input content images, one or more further frames from the training video; andgenerating, for each further input content images, using the image encoder, a respective further third set of tokens comprising a plurality of image tokens representing the corresponding further input content image, each further input content image depicting a respective obj ect, andwherein the input token sequence further comprises each of the further third sets of tokens.

29. The method of claim 27 or 28, wherein updating parameters of the denoising model based on a comparison of the target video and the training video comprises:updating parameters of the denoising model based on a comparison of a clip of the training video and the target video,wherein the input content images are sampled from frames of the training video that are not comprised in said clip of the target video.

30. The method of claim 29, wherein the parameters of the denoising model are updated based on a mean squared error loss of the clip of the target video and the training video.

31. The method of claim 29 or 30, wherein the tokens of the second set of tokens represent a description of the clip of the training video;32. The method of claim 31 further comprising processing the clip of the training video, using a video-to-text model, to generate the tokens representing the description of the clip of the training video.ATTORNEY DOCKET NO. 45288-0665WO133. The method of any one of claims 27 to 32, wherein the input content images are randomly selected from frames of the training video that are not comprised in said clip of the training video.

34. The method of any one of claims 27 to 33, wherein updating parameters of the denoising model based on a comparison of the target video and the training video comprises:generating, using a video encoder, a plurality of video tokens from the training video; andupdating parameters of the denoising model based on a comparison of the video tokens representing the training video and the output video tokens representing the target video.

35. The method of any one of claims 27 to 33, wherein updating parameters of the denoising model based on a comparison of the target video and the training video comprises:processing the plurality7of output video tokens, using a neural network decoder, to generate the target video; andupdating parameters of the denoising model based on a comparison of the training video and the generated target video.

36. The method of any one of claims 27 to 35, wherein generating, using an image encoder, the plurality of image tokens of the third set of tokens from the first input content image comprises:processing the first input content image, using the image encoder, to generate an initial embedding of the first input content image;processing the initial embedding of the first input content image, using a first linear projection layer to generate the plurality of image tokens of the third set of tokens, and wherein parameters of the denoising model and parameters of the first linear projection layer are updated based on a comparison of the target video and the training video.

37. The method of any one of claims 27 to 36, wherein the training dataset further comprises, for each training video, a respective input style image having the style of the training video, and wherein the method further comprises, for each of one or more training videos in a training dataset:generating, from the input style image, using the image encoder, a fourth set of tokens comprising a plurality of image tokens representing the input style image,ATTORNEY DOCKET NO. 45288-0665WO1wherein the input token sequence further comprises the first set, the second set, the third set and the fourth set of tokens.

38. The method of claim 36, wherein generating, from the input style image, using the image encoder, a fourth set of tokens comprising a plurality of image tokens representing the input style image comprises:processing the input style image, using the image encoder, to generate an initial embedding of the input style image;processing the initial embedding of the input style image, using a second linear projection layer to generate the plurality of image tokens of the fourth set of tokens for the input style image, andwherein parameters of the denoising model and parameters of the second linear projection layer are updated based on a comparison of the target video and the training video.

39. The method of claim 37 or 38, wherein further comprising generating a training video and an associated input style image for the training dataset by:processing natural language input, using a text-to-image model, to generate a target image and the input style image, the target image and input style image having the same style and depicting different objects; andprocessing the target image, using an image-to-video model, to generate the training video.

40. The method of any one of claims 27 to 32, wherein the one or more training videos in the training dataset represent a real-world environment.

41. The method of any preceding claim wherein the denoising model is configured to iteratively process the input token sequence comprising the input visual tokens, and optionally one or more tokens representing a denoising time step, to generate output visual tokens for denoising the input visual tokens.

42. The method of any preceding claim wherein the denoising model comprises a diffusion model.ATTORNEY DOCKET NO. 45288-0665WO143. The method of any one of claims 27 to 42 further comprising using the trained denoising model for generating, according to the method of any one of claims 1 to 26, a plurality of output visual tokens representing a target image or a target video.

44. A system comprising:one or more computers; andone or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform the operations of the respective method of any one of claims 1-43.

45. One or more non-transitory computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform the operations of the respective method of any one of claims 1-43.

46. A graphical user interface for an image or video generation system configured to generate a target image or a target video from i) a textual description of the target image or the target video and ii) one or more input content images depicting respective objects, the user interface configured to receive as user input:the textual description of the target image or the target video; andthe one or more input content images.

47. The graphical user interface of claim 46, wherein the image or video generation system is configured to generate the target image or the target video from i) a textual description of the target image or the target video, ii) one or more input content images depicting respective objects, and iii) an input style image that defines a target sty le of the target image or the target video, andwherein the user interface is further configured to receive as user input the input st le image.

48. The graphical user interface of claim 46 or 47, wherein the image or video generation system is configured to generate the target image or the target video according to the method of any one of claims 1 to 26.