Image fusion using perceptual color matching
The image processing apparatus addresses the challenges of merging images with differing content by segmenting, recoloring, and generating seamless transitions, enhancing the coherence and fidelity of the merged images.
Patent Information
- Application Number
- US19/214232
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2026-11-26
AI Technical Summary
Conventional image stitching and compositing techniques often result in unwanted artifacts such as visible color boundaries and require significant manual editing, especially when merging images with differing content, leading to unpredictable behavior and content loss.
An image processing apparatus that segments and labels regions of input images using a finetuned segmentation model, adjusts colors in a perceptual color space like CIELAB to compute a common color, and generates a merged image using an image generation model to harmonize colors and create seamless transitions.
The approach effectively merges diverse images without seams by harmonizing colors, maximizing mergeable content and removing out-of-context elements, resulting in more coherent and faithful merged images that match user intent.
Smart Images

Figure US20260378015A1-D00000_ABST
Abstract
Description
BACKGROUND
[0001] The following relates generally to image processing, and more specifically to image combination. Image processing is a type of data processing that involves the manipulation of an image to get the desired output, typically utilizing specialized algorithms and techniques. It is a method used to perform operations on an image to enhance its quality or to extract useful information from it. This process usually comprises a series of steps that includes the importation of the image, its analysis, manipulation to enhance features or remove noise, and the eventual output of the enhanced image or salient information it contains.
[0002] Image combination is a type of image processing that involves combining elements from multiple images into a single image. Image combination operations include stitching and compositing techniques. Stitching involves joining overlapping images to create a larger scene, such as panoramas. Compositing, in contrast, involves inserting elements from another image into a working image. However, image processing techniques such as stitching and compositing can be difficult and complicated to perform using conventional techniques. Furthermore, the results can include unwanted artifacts, such as visible color boundaries. Therefore, there is a need in the art for improved systems and methods for image stitching and compositing.SUMMARY
[0003] Embodiments of the present disclosure include systems and methods for fusing images together seamlessly. The embodiments include an image processing apparatus configured to receive two images, introduce a space between the images for generated content, and adjust the colors of the original images, thereby forming a combined input to an image generation model. This model infills generated content in the space such that the images are joined seamlessly. The system includes a finetuned segmentation model configured to segment and label different regions of the input images, as well as a color component configured to recolor regions of each image. According to some aspects, the color component interpolates between the colors of each pair of regions in a perceptual color space, such as the CIELAB color space, to compute a common color for the pair. The color component then adjusts each region to match this common color before the combined input is formed as conditioning to the image generation model.
[0004] A method, apparatus, non-transitory computer readable medium, and system for image combination are described. One or more aspects of the method, apparatus, non-transitory computer readable medium, and system include obtaining a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color; modifying the first image and the second image to obtain a recolored first image and a recolored second image, respectively; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object that includes at least a portion of the first object and at least a portion of the second object.
[0005] A method, apparatus, non-transitory computer readable medium, and system for image combination are described. One or more aspects of the method, apparatus, non-transitory computer readable medium, and system include obtaining a first image and a second image; segmenting the first image and the second image, respectively, to identify a first object with a first color and a second object with a second color, wherein the first object and the second object have a same category; modifying the first image and the second image by recoloring the first object and the second object to obtain a recolored first image and a recolored second image, respectively; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object that includes at least a portion of the first object and at least a portion of the second object.
[0006] An apparatus, system, and method for image combination are described. One or more aspects of the apparatus, system, and method include a memory component; a processing device coupled to the memory component, the processing device configured to perform operations comprising obtaining a first image including a first object and a second image including a second object; modifying the first image and the second image by recoloring the first object and the second object to obtain a recolored first image and a recolored second image, respectively; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object based on the first object and the second object.BRIEF DESCRIPTION OF THE DRAWINGS
[0007] FIG. 1 shows an example of an image processing system according to aspects of the present disclosure.
[0008] FIG. 2 shows an example of an image processing apparatus according to aspects of the present disclosure.
[0009] FIG. 3 shows an example of a guided latent diffusion model according to aspects of the present disclosure.
[0010] FIG. 4 shows an example of a U-Net architecture according to aspects of the present disclosure.
[0011] FIG. 5 shows an example of a diffusion transformer (DiT) architecture according to aspects of the present disclosure.
[0012] FIG. 6 shows an example of a pipeline for computing a common color according to aspects of the present disclosure.
[0013] FIG. 7 shows an example of a method a diffusion process according to aspects of the present disclosure.
[0014] FIG. 8 shows an example of a method an algorithm for merging images according to aspects of the present disclosure.
[0015] FIG. 9 shows an example of a pipeline for merging images according to aspects of the present disclosure.
[0016] FIG. 10 shows an example of a method for generating a merged image according to aspects of the present disclosure.
[0017] FIG. 11 shows an example of merged images according to aspects of the present disclosure.
[0018] FIG. 12 shows an example of a step-by-step algorithm for training machine learning (ML) according to aspects of the present disclosure.
[0019] FIG. 13 shows an example of a pipeline for training a segmentation component according to aspects of the present disclosure.
[0020] FIG. 14 shows an example of a method for training a diffusion model according to aspects of the present disclosure.
[0021] FIG. 15 shows an example of a computing device according to aspects of the present disclosure.DETAILED DESCRIPTION
[0022] Image processing techniques, such as image generation, are frequently used in creative workflows. Historically, users would rely on manual techniques and drawing software to create visual content. The advent of machine learning (ML) has enabled new workflows that automate the image creation process. These ML-based workflows can significantly reduce the time and technical expertise required to produce complex visual content, allowing creators to focus more on ideation and less on manual execution.
[0023] ML is a field of data processing that focuses on building algorithms capable of learning from and making predictions or decisions based on data. It includes a variety of techniques, ranging from simple linear regression to complex neural networks, and plays a significant role in automating and optimizing tasks that would otherwise require extensive human intervention.
[0024] Image stitching is a common image processing technique that combines multiple photographs with overlapping fields of view to produce a segmented panorama or high-resolution image. Traditional approaches rely on identifying corresponding points between images using feature extraction methods such as Scale-Invariant Feature Transform (SIFT), Speeded-Up Robust Features (SURF), or Histogram of Oriented Gradients (HOG). These algorithms detect distinctive keypoints and generate descriptors that can be matched across images to align and blend them seamlessly. The images are then frequently transformed with affine transformations to provide plausible perspective continuity. Techniques such as HOG, SIFT, and SURF can be used to find matching regions for image stitching. Additional techniques can be used to reduce the required domain knowledge and skill for image combination.
[0025] However, stitching and compositing can result in unpredictable behavior and can necessitate additional manual editing. Furthermore, available stitching techniques are not applicable to combining images that don't have naturally aligning elements. For example, conventional stitching techniques are not applicable when merging images with largely differing content, such as distinct artwork elements or objects without significant overlap. In such cases, simply providing two disparate images as conditioning to image generation models often results in noticeable seams or borders in the output. These visual discontinuities mainly stem from color differences between potentially mergeable regions in the source images. Traditional masking approaches attempt to direct neural networks to maintain the original colors, which results in preserving the unwanted color disparities and prevents seamless integration.
[0026] Furthermore, approaches that rely on foreground object detection or background removal can result in significant content loss from the original artworks. For instance, simply masking out backgrounds can cause prominent features like skies, landscapes, or contextual elements to be omitted from the final merged image. New approaches are needed that specifically address these color harmonization issues.
[0027] Embodiments of the present disclosure improve image generation systems by generating merged images with more accuracy and mitigating seams between input contents. The embodiments include an image processing apparatus configured to receive two images, introduce a space between the images for generated content, and adjust the colors of the original images. A finetuned segmentation model segments and labels different regions of the input images, while a color component recolors regions of each image. The color component interpolates between the colors of each pair of regions in a perceptual color space, such as the CIELAB color space, to compute a common color for the pair, and then adjusts each region to match this common color. The adjusted images form a combined input to an image generation model that infills content in the introduced space. According to some aspects, this approach effectively merges diverse images without seams by harmonizing the colors of key objects before generation, allowing the model to focus on creating coherent transitions between objects rather than managing color disparities. Through this approach, embodiments further maximize mergeable content from the original images and may remove out-of-context elements. This results in more coherent and faithful merged images that match the user's intent.
[0028] As used herein, “common color” refers to a color that is computed based on a first color of a region from a first image and a second color from a region of a second image. For example, the computed color may become common between the two regions after the colors of the two regions are updated. Additional detail regarding the common color computation is provided with reference to FIG. 6.
[0029] As used herein, “vectorizable” describes attributes of an image that enables it to be efficiently and accurately translated from pixel data to vector image format. Characteristics of vectorizable images may include, but are not limited to, flat or solid color regions, clearly defined shapes or boundaries, and the absence of gradient transitions or fuzzy edges. These attributes facilitate a seamless conversion process, minimizing data loss and retaining the fidelity of the original image attributes during the transformation from a rasterized format to a vectorized representation. Conversely, non-vectorizable images, characterized by complex textures, gradients, or undefined boundaries, can be prone to generating excessive paths during the vectorization process. This surplus of paths can hinder editability, lead to a cumbersome or large file structure, and result in inaccuracies after transformations, particularly when scaling the image to larger dimensions.
[0030] As used herein, a “same category” between two regions refers to the same or similar semantic label as determined by the segmentation model, such as a “background” label. Objects belonging to the same category share common semantic attributes that make them suitable for merging, even when they appear in separate images. For example, two “tree” objects or two “sky” regions might be identified as having the same category despite visual differences in their appearance.
[0031] As used herein, “perceptual color space” refers to a color representation system designed to align with human visual perception, where distances between colors correspond to perceived differences by a human observer. Unlike RGB color space which is device-dependent, perceptual color spaces such as CIELAB (also known as CIE Lab*) represent colors in ways that account for how humans perceive color differences. These spaces are particularly useful for color interpolation and manipulation because they provide a more uniform representation of color changes across the visible spectrum between two given points in the space.
[0032] As used herein, “combined object” refers to a visual element in a merged image that incorporates characteristics from both a first object in a first image and a second object in a second image. The combined object includes at least portions of both original objects and exhibits a coherent transition between these portions. This may involve both the preservation of original content from each source image and the generation of synthetic content to create seamless boundaries between the preserved portions.
[0033] An image processing system configured to merge input images is described with reference to FIGS. 1-6. Methods for merging input images are described with reference to FIGS. 7-10. Additional examples of merged images are described with reference to FIG. 11. Training systems and methods are described with reference to FIGS. 12-14. A computing device configurable to implement an image processing apparatus is described with reference to FIG. 15.Image Processing System
[0034] FIG. 1 shows an example of an image processing system according to aspects of the present disclosure. The example shown includes image processing apparatus 100, database 105, network 110, user 115, separate images 120, and merged image 125. Image processing apparatus 100 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 2. Merged image 125 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 9. Database 105 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 13.
[0035] In one example, user 115 provides inputs including separate images 120, which are images that the user wishes to merge into a seamless single image. Image processing apparatus 100 then processes the inputs by performing segmentation operations, adjusting the images' colors, and preparing condition signals for an image generation model. The image generation model generates merged image 125, which the system then provides to user 115 via, e.g., a user interface.
[0036] In some embodiments, one or more components of image processing apparatus 100 are implemented on a server. A server provides one or more functions to users linked by way of one or more of the various networks. In some cases, the server includes a single microprocessor board, which includes a microprocessor responsible for controlling all aspects of the server. In some cases, a server uses microprocessor and protocols to exchange data with other devices / users on one or more of the networks via hypertext transfer protocol (HTTP), and simple mail transfer protocol (SMTP), although other protocols such as file transfer protocol (FTP), and simple network management protocol (SNMP) may also be used. In some cases, a server is configured to send and receive hypertext markup language (HTML) formatted files (e.g., for displaying web pages). In various embodiments, a server comprises a general-purpose computing device, a personal computer, a laptop computer, a mainframe computer, a super computer, or any other suitable processing apparatus.
[0037] Database 105 is configured to store information used by the image processing system. For example, database 105 may store model parameters, generated images, generated videos, user configuration settings, activity history, model training data, and the like. A database is an organized collection of data. For example, a database stores data in a specified format known as a schema. A database may be structured as a single database, a distributed database, multiple distributed databases, or an emergency backup database. In some cases, a database controller may manage data storage and processing in a database. In some cases, a user interacts with the database controller. In other cases, the database controller may operate automatically without user interaction.
[0038] Network 110 facilitates the transfer of information between image processing apparatus 100, database 105, and user 115. In some cases, network 110 is referred to as a “cloud”. A cloud is a computer network configured to provide on-demand availability of computer system resources, such as data storage and computing power. In some examples, the cloud provides resources without active management by the user. The term cloud is sometimes used to describe data centers available to many users over the Internet. Some large cloud networks have functions distributed over multiple locations from central servers. A server is designated an edge server if it has a direct or close connection to a user. In some cases, a cloud is limited to a single organization. In other examples, the cloud is available to many organizations. In one example, a cloud includes a multi-layer communications network comprising multiple edge routers and core routers. In another example, a cloud is based on a local collection of switches in a single physical location.
[0039] FIG. 2 shows an example of an image processing apparatus 200 according to aspects of the present disclosure. The example shown includes image processing apparatus 200, processor 205, memory 210, user interface 215, segmentation model 220, color matching component 225, image generation model 230, vectorization component 235, and training component 240.
[0040] Image processing apparatus 200 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 1. Segmentation model 220 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 13. Image generation model 230 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 9. Color matching component 225 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 6. Training component 240 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 13.
[0041] A processor 205 is an intelligent hardware device, (e.g., a general-purpose processing component, a digital signal processor 205 (DSP), a central processing unit (CPU), a graphics processing unit (GPU), a microcontroller, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, or any combination thereof). The processor 205 may be configured to perform millions or billions of tensor operations per second, enabling real-time processing of complex visual data through parallel computation paths. In some cases, the processor 205 is configured to operate a memory 210 array using a memory controller. In other cases, a memory controller is integrated into the processor 205. In some cases, the processor 205 is configured to execute computer-readable instructions stored in a memory 210 to perform various functions. In some embodiments, a processor 205 includes special purpose components for image segmentation, neural network acceleration, or image generation acceleration such as tensor units, token routing, or quantization / truncation operations.
[0042] Memory 210 stores information used in the operation of image processing apparatus 200. Examples of a memory device include random access memory (RAM), read-only memory (ROM), or a hard disk. Examples of memory devices include solid state memory and hard disk drives. In some examples, memory 210 is used to store computer-readable, computer-executable software including instructions that, when executed, cause processor 205 to perform various functions described herein. In some cases, the memory 210 contains, among other things, a basic input / output system (BIOS) which controls basic hardware or software operation such as the interaction with peripheral components or devices. In some cases, a memory controller operates memory cells. For example, the memory controller can include a row decoder, column decoder, or both. In some cases, memory cells within memory 210 store information in the form of a logical state.
[0043] According to some aspects, some components of the image processing apparatus 200 may include dedicated memories as indicated by the ‘MEM’ elements in FIG. 2. These dedicated memories may store model parameters that, when combined with mathematical operations executed by processor 205, cause the corresponding components to perform the functions described herein. In some embodiments, the dedicated memories are implemented as non-transitory computer-readable mediums. The parameters may be stored statically or configured at runtime. For example, adjustments to the parameters may be made during pretraining processes, finetuning processes, or user-configuration processes such as hot-swapping different models. In certain implementations, these specialized memory structures enable hardware-accelerated execution of complex computational functions through purpose-built circuitry optimized for specific operations, thereby transforming the general-purpose computing device into a specialized machine uniquely configured to perform the particular image processing operations described herein. The dedicated memories may be coupled with specialized processing units, such as tensor processing units or neural processing units, which implement custom data paths specifically designed to execute the mathematical operations required by the image processing components.
[0044] A user interface 215 enables a user to interact with image processing apparatus 200. In some embodiments, user interface 215 includes an audio device, such as an external speaker system, an external display device such as a display screen, or an input device (e.g., remote control device interfaced with the user interface 215 directly or through an IO controller module). In some cases, user interface 215 includes a graphical user interface (GUI).
[0045] Some components of image processing apparatus 200 such as segmentation model 220 and image generation model 230 may use one or more convolutional neural networks (CNNs) in their implementation. A CNN is a class of neural network that is commonly used in computer vision or image classification systems. In some cases, a CNN may enable processing of digital images with minimal pre-processing. A CNN may be characterized by the use of convolutional (or cross-correlational) hidden layers. These layers apply a convolution operation to the input before signaling the result to the next layer. Each convolutional node may process data for a limited field of input (i.e., the receptive field). During a forward pass of the CNN, filters at each layer may be convolved across the input volume, computing the dot product between the filter and the input. During the training process, the filters may be modified so that they activate when they detect a particular feature within the input.
[0046] Segmentation model 220 is configured to segment an input image into different regions. In digital image processing and computer vision, image segmentation is the process of partitioning a digital image into multiple segments (sets of pixels, also known as image objects). The goal of segmentation is to simplify and / or change the representation of an image into something that is more meaningful and easier to analyze. Image segmentation is typically used to locate objects and boundaries (lines, curves, etc.) in images. More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain characteristics.
[0047] According to some aspects, image segmentation is performed by a trained artificial neural network (ANN). For example, a fully convolutional network (FCN) replaces the feed-forward elements of a multilayer perceptron (MLP) with convolutional neural networks (CNNs). The FCN may be trained to take an image as input and generate pixel-wise labels as outputs. These networks learn features directly from image data to identify objects and boundaries. The trained model processes input images to produce masks that delineate objects of interest.
[0048] According to some aspects, segmentation model 220 segments the first image to identify the first object. In some examples, segmentation model 220 segments the second image to identify the second object. In some aspects segmentation model 220 is trained on vectorizable images. In some examples, segmentation model 220 determines that the first object and the second object have a same category, where the common color is determined based on the first object and the second object having the same category.
[0049] Color matching component 225 is configured to find a common color between two colors, and to update the colors of one or more image regions computed by segmentation model 220. The common color may be, for example, an interpolated color between the two colors in a perceptual color space. Perceptual color spaces such as CIELAB (also known as CIE Lab*) represent colors in ways that account for how humans perceive color differences. These spaces are particularly useful for color interpolation and manipulation because they provide a more uniform representation of color changes across the visible spectrum between two given points in the color space. Additional detail regarding color matching is described with reference to FIG. 6.
[0050] According to some aspects, color matching component 225 determines a common color based on the first color and the second color. In some examples, color matching component 225 modifies the first image and the second image based on the common color to obtain a recolored first image and a recolored second image, respectively, where the recolored first image depicts the first object with the common color and the recolored second image depicts the second object with the common color. In some examples, color matching component 225 converts the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively. In some examples, color matching component 225 interpolates between the converted first color and the converted second color to obtain the common color. In some examples, color matching component 225 converts the first image and the second image from an RGB color space to a perceptual color space.
[0051] Image generation model 230 is a machine learning (ML) model configured to generate visual data, such as images. The image generation model 230 may perform its generation with guidance from external conditions, such as other images, texts, or other data. Embodiments of image generation model 230 perform a generation process that, when conditioned on input images adjusted by segmentation model 220 and color matching component 225, generate a seamlessly merged image. Additional technical detail on the image generation process is provided with reference to FIGS. 3-5 and FIG. 7.
[0052] According to some aspects, image generation model 230 generates a merged image based on the recolored first image and the recolored second image, where the merged image depicts a combined object with the common color, where the combined object includes at least a portion of the first object and at least a portion of the second object. In some aspects, the merged image includes first original content from the first image in a first region corresponding to the first image, second original content from the second image in a second region corresponding to the second image, and synthetic content in a third region located between the first region and the second region. In some examples, image generation model 230 performs a diffusion process based on the first recolored image and the second recolored image. In some aspects, the image generation model 230 includes a diffusion model, which is described in greater detail with reference to FIG. 3.
[0053] Embodiments of image generation model 230 may be based on a CNN-backbone such as a U-Net-based diffusion model, a transformer backbone such as a diffusion transformer (DiT), or another ANN configured to generate data by iteratively denoising a sample. A transformer or transformer network is a type of neural network model used for natural language processing tasks. A transformer network transforms one sequence into another sequence using an encoder and a decoder. Encoder and decoder include modules that can be stacked on top of each other multiple times. The modules comprise multi-head attention and feed forward layers. The inputs and outputs (target sentences) are first embedded into an n-dimensional space. Positional encoding of the different words (i.e., give every word / part in a sequence a relative position since the sequence depends on the order of its elements) are added to the embedded representation (n-dimensional vector) of each word. In some examples, a transformer network includes attention mechanism, where the attention looks at an input sequence and decides at each step which other parts of the sequence are important. The attention mechanism involves query, keys, and values denoted by Q, K, and V, respectively. Q is a matrix that contains the query (vector representation of one word in the sequence), K are all the keys (vector representations of all the words in the sequence) and V are the values, which are again the vector representations of all the words in the sequence. For the encoder and decoder, multi-head attention modules, V consists of the same word sequence than Q. However, for the attention module that is taking into account the encoder and the decoder sequences, V is different from the sequence represented by Q. In some cases, values in V are multiplied and summed with some attention-weights a.
[0054] Vectorization component 235 is configured to convert a pixel representation of an image into a vector formation representation. Vector format representation of images stores visual information as mathematical paths, shapes, and formulas rather than individual pixels. Unlike raster images composed of pixel grids, vector images use geometric primitives such as points, lines, curves, and polygons to represent visual content. These mathematical descriptions enable vector images to scale infinitely without losing quality or resolution. Vector formats typically define objects with attributes such as shape, position, color, and stroke width, making them particularly efficient for storing images with distinct elements and sharp boundaries.
[0055] Vectorization is the process of converting pixel-based raster images into vector format representations. Images with “vectorizable” characteristics are more conducive to this transformation, particularly those featuring flattened colors, clear shape boundaries, and limited gradients. Various vectorization techniques may be used, including edge detection, contour tracing, color quantization, and shape recognition algorithms. In some implementations, trained machine learning models identify and trace object boundaries to generate vector paths. These ML-based approaches can recognize patterns and shapes in complex images, producing cleaner vector outputs even from photographs or detailed illustrations that traditional algorithmic approaches might struggle to process effectively.
[0056] Training component 240 is configured to update parameters of the various ML-based components of image processing apparatus 200 such as segmentation model 220 and image generation model 230. Embodiments of training component 240 are further configured to generate training data. Additional detail regarding these processes is described with reference to FIGS. 12-14.
[0057] FIG. 3 shows an example of a guided latent diffusion model 300 according to aspects of the present disclosure. The guided latent diffusion model 300 depicted in FIG. 3 is an example of, or includes aspects of, the image generation model 230 described with reference to FIG. 2.
[0058] Diffusion models are a class of generative neural networks which can be trained to generate new data with features similar to features found in training data. In particular, diffusion models can be used to generate novel images. Diffusion models can be used for various image generation tasks including image super-resolution, generation of images with perceptual metrics, conditional generation (e.g., generation based on text guidance), image inpainting, and image manipulation.
[0059] Types of diffusion models include Denoising Diffusion Probabilistic Models (DDPMs) and Denoising Diffusion Implicit Models (DDIMs). In DDPMs, the generative process includes reversing a stochastic Markov diffusion process. DDIMs, on the other hand, use a deterministic process so that the same input results in the same output. Diffusion models may also be characterized by whether the noise is added to the image itself, or to image features generated by an encoder (i.e., latent diffusion).
[0060] Diffusion models work by iteratively adding noise to the data during a forward process and then learning to recover the data by denoising the data during a reverse process. For example, during training, guided latent diffusion model 300 may take an original image 305 in a pixel space 310 as input and apply and image encoder 315 to convert original image 305 into original image features 320 in a latent space 325. Then, a forward diffusion process 330 gradually adds noise to the original image features 320 to obtain noisy features 335 (also in latent space 325) at various noise levels.
[0061] Next, a reverse diffusion process 340 (e.g., a U-Net ANN or a diffusion transformer (DiT) ANN) gradually removes the noise from the noisy features 335 at the various noise levels to obtain denoised image features 345 in latent space 325. In some examples, the denoised image features 345 are compared to the original image features 320 at each of the various noise levels, and parameters of the reverse diffusion process 340 of the diffusion model are updated based on the comparison. Finally, an image decoder 350 decodes the denoised image features 345 to obtain an output image 355 in pixel space 310. In some cases, an output image 355 is created at each of the various noise levels. The output image 355 can be compared to the original image 305 to train the reverse diffusion process 340.
[0062] In some cases, image encoder 315 and image decoder 350 are pre-trained prior to training the reverse diffusion process 340. In some examples, they are trained jointly, or the image encoder 315 and image decoder 350 and finetuned jointly with the reverse diffusion process 340.
[0063] The reverse diffusion process 340 can also be guided based on a text prompt 360, or another guidance prompt, such as an image, a layout, a segmentation map, etc. The text prompt 360 can be encoded using a text encoder 365 (e.g., a multimodal encoder) to obtain guidance features 370 in guidance space 375. The guidance features 370 can be combined with the noisy features 335 at one or more layers of the reverse diffusion process 340 to ensure that the output image 355 includes content described by the text prompt 360. For example, guidance features 370 can be combined with the noisy features 335 using a cross-attention block within the reverse diffusion process 340. The process may be repeated to generate frames of a video, or may be carried out on a spectrogram data and passed through a vocoder to generate sound. According to some aspects, diffusion models that are used to generate videos and / or sound may include additional architectural adaptations, such as temporal layers that ensure coherency between frames or waveforms.
[0064] FIG. 4 shows an example of a U-Net 400 according to aspects of the present disclosure. In some examples, U-Net 400 is an example of the component that performs the reverse diffusion process 340 of guided diffusion model 300 described with reference to FIG. 3, and includes architectural elements of the image generation model 230 described with reference to FIG. 2. The U-Net 400 depicted in FIG. 4 is an example of, or includes aspects of, the architecture used within the reverse diffusion process described with reference to FIG. 7.
[0065] In some examples, diffusion models are based on a neural network architecture known as a U-Net. The U-Net 400 takes input features 405 having an initial resolution and an initial number of channels and processes the input features 405 using an initial neural network layer 410 (e.g., a convolutional network layer) to produce intermediate features 415. The intermediate features 415 are then down-sampled using a down-sampling layer 420 such that down-sampled features 425 have a resolution less than the initial resolution and a number of channels greater than the initial number of channels.
[0066] This process is repeated multiple times, and then the process is reversed. That is, the down-sampled features 425 are up-sampled using up-sampling process 430 to obtain up-sampled features 435. The up-sampled features 435 can be combined with intermediate features 415 having a same resolution and number of channels via a skip connection 440. These inputs are processed using a final neural network layer 445 to produce output features 450. In some cases, the output features 450 have the same resolution as the initial resolution and the same number of channels as the initial number of channels.
[0067] In some cases, U-Net 400 takes additional input features to produce conditionally generated output. For example, the additional input features could include a vector representation of an input prompt. The additional input features can be combined with the intermediate features 415 within the neural network at one or more layers. For example, a cross-attention module can be used to combine the additional input features and the intermediate features 415. Embodiments of the image generation model described herein may combine anchor features in a similar manner, but instead of adding the influence of the anchor features, embodiments may subtract the influence. This can be achieved by computing attention weights for the anchor features and then subtracting the resulting weighted features from the intermediate features 415. By doing so, the model reduces the presence of elements associated with the anchor features in the generated output.
[0068] FIG. 5 shows an example of a diffusion transformer (DiT) architecture according to aspects of the present disclosure. While some generative diffusion models are based on a convolutional layer backbone (e.g., the U-Net), others may be based on a transformer network backbone.
[0069] The example shown includes predicted noise 505, predicted covariance 510, linear and reshape layers 515, normalization layer 520, DiT block(s) 525, patchify operation 530, embedding 535, noised latent 540, timestep information 545, label information 550, and an implementation of one block in the DiT block(s) 525 by a DiT Block 596. The DiT Block 596 includes: second residual connection 560, second scaling operations 562, feed-forward network 564, post-normalization second scaling and shifting 566, second normalization 568, first residual connection 570, first scaling operations 572, self-attention 674, post-normalization first scaling and shifting 576, first normalization 578, input tokens 580, conditioning tokens 582, multi-layer perceptron (MLP) 584, post-normalization first scaling and shifting parameters 586, first scaling parameter 588, post-normalization second scaling and shifting parameters 590, and second scaling parameter 592. In some embodiments, the architecture uses a Latent Diffusion Transformer 594. In some embodiments, DiT Block 596 uses an “adaLN-Zero” technique.
[0070] Diffusion Transformers (DiTs) is a popular architecture for diffusion models and is designed to be structurally faithful to standard transformer architecture. DiT incorporates transformer structures' scaling properties. For training denoising diffusion probabilistic models (DDPMs) of images (e.g., spatial representations of images), DiT is based on a Vision Transformer (ViT) architecture which operates on sequences of patches. DiT processes images by dividing them into patches, converting these patches into tokens, and applying attention mechanisms to model relationships between different regions of the image. This approach allows the model to capture both local and long-range dependencies in the image generation process.
[0071] In some cases, input to DiT is a spatial representation z. For 256×256×3 images, z has shape 32×32×4. A first layer of a DiT is to carry out patchify operation, where the DiT divides an input image into patches and converts the patches (a form of spatial input) into a sequence of T tokens, each of dimension d, by linearly embedding each patch in the input. Following the patchify process, ViT frequency-based positional embeddings are applied to all input tokens. In some cases, the number of tokens T created by patchify is determined by a patch size hyperparameter p. In some cases, T=(I / p)2, where I is another shape parameter, thus halving p will quadruple T, which in some cases at least quadruples total of transformer Giga Floating Point Operations (Gflops). In some examples, changing p has no impact on downstream parameter counts, i.e., parameter counts in downstream layers of DiT is independent from p. In some examples, p=2, 4 or 8. Various patch sizes, transformer block architectures and model sizes are implemented.
[0072] Following Patchify operation, attention mechanisms are applied to model relationships between different regions of the image in one or more DiT blocks. In addition to noised image inputs, diffusion models sometimes process additional conditional information such as noise timesteps t, class labels c, natural language information, etc. Four variants of transformer blocks for processing conditional inputs including both input information and conditional information are described below.
[0073] In some cases, DiT blocks in the DiT network are implemented using adaptive layer norm (adaLN) blocks. Following adaptive normalization layers in generative adversarial networks (GANs) and conventional diffusion models with U-Net backbones, in some examples, standard normalization layers in transformer blocks are replaced with adaptive layer norm (adaLN). Rather than directly learning dimension-wise scale γ and shift parameters β, in adaLN the system regresses γ and β from a sum of the embedding vectors of the noise timesteps t and the class labels c. An adaLN adds relatively small numbers of Gflops and is more efficient. Additionally, adaLN is a conditioning mechanism that applies a same function to all tokens.
[0074] In some cases, DiT blocks in the DiT network are implemented using adaLN-Zero blocks, which leverages zero-initialization techniques. In Residual Networks (ResNets), initializing each residual block as the identity function x→x is beneficial. In some examples, zero-initializing a final batch norm scale factor γ in each block accelerates large-scale training in supervised learning settings. Diffusion models based on U-Nets use a similar initialization strategy, zero-initializing final convolutional layer in each block prior to residual connections. An adaLN-Zero block is modified from an adaLN block using similar zero-initialization techniques. In addition to regressing the dimension-wise scale γ and the shifting parameters β, the system also regresses dimension-wise scaling parameters as that are applied immediately prior to residual connections within the DiT block. The network initializes a multi-layer perceptron (MLP) to output a zero-vector for all as; this initializes an entire DiT block as the identity function. As with the adaLN block, adaLNZero adds negligible Gflops to the model.
[0075] In some cases, DiT blocks in the DiT network are implemented using in-context conditioning, where vector embeddings of t and c are appended as two additional tokens in the input sequence, and after a final block, the network removes the two conditioning tokens from the sequence.
[0076] In some cases, DiT blocks in the DiT network include cross-attention blocks. The DiT network concatenates the embeddings of t and c into a length-two sequence, separate from the image token sequence. The transformer block is modified to include an additional multi-head cross-attention layer following the multi-head self-attention block.
[0077] In some cases, the DiT network includes a sequence of N DiT blocks, each operating at a hidden dimension size d. Following ViT, the DiT network uses standard transformer configs that jointly scale N, d and attention heads. In some examples, Small(S), Base (B), Large (L) variants, XLarge (XL) variants of model sizes are implemented. Small or Base model sizes have N=12 layers of DiT blocks, Large model sizes have 24 layers of DiT blocks. XLarge model sizes have 28 layers of DiT blocks.
[0078] After a final DiT block, the DiT network decodes the sequence of image tokens into an output noise prediction and an output diagonal covariance prediction. Both outputs have shape equal to an original spatial input. Standard linear decoder is utilized to decode, wherein a final normalization layer (or adaptive normalization layer if the DiT block is an adaLN block) and linearly decode each token into a p×p×2C tensor, where C is a number of channels in the spatial input to the DiT network and p is the patch size hyperparameter. Finally, decoded tokens are rearranged into their original spatial layout to get the predicted noise and covariance.
[0079] The architecture 500, in some cases, uses a Latent Diffusion Transformer 594. The architecture 500 processes noised latent 540, which may be a noised version of an input image encoded in a latent space. Patchify operation 530 divides the noised latent into a sequence of patches that are processed as tokens. The tokens are vector representations of each patch of the image in latent space, and are adjusted through attention processes. Each of the tokens also receives timestep information 545 and label information 550 and, accordingly, their embedding 535, which encodes the current denoising timestep and class labels as conditional information. In some cases, embedding 535 is referred to as conditional embedding or conditional information embedding. In some cases, a positional embedding which encodes each token's spatial position in the image is applied to the patchified input tokens at the patchify operations 530. In some examples the positional embedding is ViT frequency-based positional embedding. The input tokens 580 generated by the patchify operation 530 and the conditioning tokens 582 generated by the embedding 535 are processed through N DiT block(s) 525, where N may be 52, 24 or 28. Other values of N may be used. In some cases, conditional tokens refer to tokens generated based on embedding 535 encoding timestep information 545 and label information 550.
[0080] Each of the DiT block(s) 525 includes multiple processing stages. DiT Block 596 illustrates an embodiment of one block in the DiT block(s) 525. In some embodiments, the DiT Block 596 is an example of, or includes aspects of, the adaLN-Zero block. In some cases, input tokens 580 interact with the conditioning tokens 582 through multiple attention mechanisms. Particularly, after first normalization 578 applied to the input tokens and MLP 584 to the conditional tokens, MLP 584 generates or updates post-normalization first scaling and shifting parameters 586, denoted as γ1, β1, for post-normalization first scaling and shifting 576 to scale and shift the output of first normalization 578 accordingly. As the normalized input tokens obtained from first normalization 578 are scaled and shifted at post-normalization first scaling and shifting 576 using the conditional information carried as least in γ1, β1, this allows the input information and conditional information to interact. Self-attention 574 allows the scaled and shifted normalized input tokens, namely the output from post-normalization first scaling and shifting 576, to attend to each other. MLP 584 also generates or updates first scaling parameter 588 denoted as &1 for first scaling operations 572 to scale the output of self-attention 574 (e.g., multi-head self-attention), further interacting the input information and conditional information. The input tokens 580 is then summed with the output of first scaling operations 572 at first residual connection 570. In some examples, α1 has initial values 0, and the DiT Block 596 is initialized as the identity function.
[0081] A similar process is performed in a second half of the DiT Block 596. MLP 584 generates or updates post-normalization second scaling and shifting parameters 590, denoted as γ2, β2, for post-normalization second scaling and shifting 566 to scale and shift the output of second normalization 568 accordingly. As the output from second normalization 568 is scaled and shifted using the conditional information carried at least in γ2, β2, this allows the input information and conditional information to further interact. Feed-forward network 564 then processes the scaled and shifted output from post-normalization second scaling and shifting 566. MLP 584 also generates or updates second scaling parameter 592 denoted as α2 for second scaling operations 562 to scale the output of feed-forward network 564, further interacting the input information and conditional information. In some cases, the feed-forward network 564 is a pointwise feed-forward network. The output from first residual connection 570 is then summed with the output of second scaling operations 562 at second residual connection 560, and the result is the final output of DiT Block 596. In some examples, α2 has initial values 0, and the DiT Block 596 is initialized as the identity function. This process repeats for each DiT block in the sequence.
[0082] After processing through all DiT block(s) 525, the outputs undergo normalization layer 520 followed by linear and reshape layers 515. The final output is the predicted noise 505, which represents the model's prediction of the noise that was added to initially create the noised latent 540, and the predicted covariance 510, which represents the model's prediction of the covariance. The predicted noise 505 is removed from noised latent 540 at each diffusion timestep, and the predicted covariance may affect how noise is removed or resampled in the reverse or denoising process. At the end of the denoising schedule, the latent sample is decoded to generate the synthetic image in pixel space.
[0083] FIG. 6 shows an example of a pipeline for computing a common color 645 according to aspects of the present disclosure. The example shown includes first image region 600, first color 605, second image region 610, second color 615, color matching component 620, first converted color 635, second converted color 640, and common color 645. Color matching component 620 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 2.
[0084] In an example process, a user may provide first and second images to be merged. A segmentation model, such as the one described with reference to FIG. 2, may segment the images to obtain first image region 600 having first color 605 and second image region 610 having second color 615. According to some aspects, the first and second images may be vectorizable artworks with relatively flat and constant colors. In such cases, first color 605 and second color 615 may be a median or mode color of the regions. In some examples, first color 605 and second color 615 are an average color of the regions.
[0085] Image segmentation is the process of partitioning an image into multiple segments, where each segment corresponds to a different part or object within the image. Semantic segmentation, in particular, refers to the task of assigning a label or category to every pixel in an image such that pixels with the same label share semantic information (e.g., “sky,”“tree,” etc.). For merging two images, semantic segmentation may be used to identify and distinguish meaningful objects or regions in each image before aligning them based on their semantic features.
[0086] In some embodiments, the segmentation model may be a Fully Convolutional Network (FCN). An FCN is a robust model architecture for semantic segmentation that uses deep learning components, particularly convolutional neural networks (CNNs), to efficiently process and segment images. FCNs are a variation of CNNs that replaces fully connected layers typically used for classification with convolutional layers to generate dense, pixel-wise predictions. Unlike traditional CNNs, FCNs may accept input images of arbitrary size and output segmentation maps that retain spatial correspondence with the input.
[0087] In some examples, a Fully Convolutional Network (FCN) for semantic segmentation may include three parts: an encoder, a fully convolutional transformation, and a decoder. The encoder is the feature extraction stage of the network, and processes the input image through multiple layers of convolution and pooling to progressively extract high-level semantic features while reducing spatial resolution. The fully convolutional transformation may replace traditional fully connected layers with convolutional layers, which enables the network to produce spatially dense predictions. The decoder may reconstruct the full-resolution segmentation map from the low-resolution score map produced by the encoder and transformation stages.
[0088] In some embodiments, a classification component of the segmentation model generates additional semantic information by mapping feature maps to class-specific score maps using 1×1 convolutions. These layers may perform a linear transformation of the feature maps to produce pixel-wise class scores, resulting in a set of score maps where each pixel represents the network's confidence in assigning that pixel to a particular class. This semantic information may be used to determine which regions in different images share the same category and are therefore suitable candidates for merging. Embodiments are not necessarily limited thereto however, and the segmentation model may include additional generative components for generating descriptive texts associated with each class.
[0089] The segmentation model may be finetuned in a process described with reference to FIG. 13. In some examples, the model may be initially trained on a general dataset and then further refined to better handle vectorizable images with clear boundaries and flat color regions. This finetuning process may improve the model's ability to accurately segment regions in the types of images that are most commonly used for the merging process described herein.
[0090] After segmentation to obtain first image region 600, first color 605, second image region 610, and second color 615, color matching component 620 performs operations including color space conversion 625 and color interpolation 630. According to some aspects, color space conversion 625 converts first color 605 and second color 615 into a perceptual color space. In some embodiments, the color matching component 620 converts an input RGB value into a CIEXYZ space color using the following transformation:[XYZ]=[0.41240.35760.18050.21260.75120.07220.01930.11920.9505][RGB](1)where XYZ refers to the three tristimulus values that correspond to the three types of cone cells in the human eye, representing a device-independent way to define color, and RGB refers to red, green, and blue values in the RGB color space. Embodiments may then convert the XYZ color into Lab color using transformation equations that map the XYZ values to the perceptually uniform Lab color space. Embodiments may then convert the XYZ color into Lab color using:L*=116f(YYn)-16(2)a*=500(f(XXn)-f(YYn))b*=200(f(YYn)-f(ZZn))where L* represents the perceived lightness of the color (ranging from black at 0 to white at 100), a* represents the color's position on the red-green axis (with negative values indicating green and positive values indicating red), and b* represents the color's position on the blue-yellow axis (with negative values indicating blue and positive values indicating yellow). Xn, Yn, and Zn refer to the tristimulus values of a reference white point, which provides a standard against which other colors are measured and ensures consistent color representation across different viewing conditions.These computations yield first converted color 635 and second converted color 640 in the perceptual color space (e.g. CIELAB). Embodiments may interpolate between these colors by using a scalar weight alpha, e.g.:common color=α*colorα+(1−α)*colorb (3)where α is a scalar weight represents the contribution of colorα to common color 645. Embodiments may then adjust first image region 600 and second image region 610 to be both common color 645.Merging ImagesAfter identifying common colors between pairs of regions, and adjusting the pairs of regions to have the common color, embodiments may perform image generation using the adjusted images as conditioning to generate the merged image. For example, an image generation model may perform a diffusion process to generate a merged image.FIG. 7 shows a diffusion process 700 according to aspects of the present disclosure. In some examples, diffusion process 700 describes an operation of the image generation model 230 described with reference to FIG. 2, such as the reverse diffusion process 340 of guided diffusion model 300 described with reference to FIG. 3. According to some aspects, the diffusion process can also be used in the generation of sounds and videos.As described above with reference to FIG. 3, using a diffusion model can involve both a forward diffusion process 705 for adding noise to an image (or features in a latent space) and a reverse diffusion process 710 for denoising the images (or features) to obtain a denoised image. The forward diffusion process 705 can be represented as q(xt|xt−1), and the reverse diffusion process 710 can be represented as p(xt−1|xt). In some cases, the forward diffusion process 705 is used during training to generate images with successively greater noise, and a neural network is trained to perform the reverse diffusion process 710 (i.e., to successively remove the noise).In an example forward process for a latent diffusion model, the model maps an observed variable x0 (either in a pixel space or a latent space) intermediate variables x1, . . . , xT using a Markov chain. The Markov chain gradually adds Gaussian noise to the data to obtain the approximate posterior q(x1:T|x0) as the latent variables are passed through a neural network such as a U-Net, where x1, . . . , xT have the same dimensionality as x0.
[0096] The neural network such as a U-Net based ANN or a DiT may be trained to perform the reverse process. During the reverse diffusion process 710, the model begins with noisy data xT, such as a noisy image 715 and denoises the data to obtain the p(xt−1|xt). At each step t−1, the reverse diffusion process 710 takes xt, such as first intermediate image 720, and t as input. Here, t represents a step in the sequence of transitions associated with different noise levels. The reverse diffusion process 710 outputs xt−1, such as second intermediate image 725 iteratively until xT reverts back to x0, the original image 730. The reverse process can be represented as:pθ(xt−1|xt):=N(xt−1;μθ(xt,t),Σθ(xt,t)) (4)
[0097] The joint probability of a sequence of samples in the Markov chain can be written as a product of conditionals and the marginal probability:xT:pθ(x0:T):=p(xT)Πt=1Tpθ(xt−12|xt) (5)where p(xT)=N(xT; 0, I) is the pure noise distribution as the reverse process takes the outcome of the forward process, a sample of pure noise, as input and Πt=1T pθ(xt−1|xt) represents a sequence of Gaussian transitions corresponding to a sequence of addition of Gaussian noise to the sample.
[0099] At inference time, observed data x, in a pixel space can be mapped into a latent space as input and a generated data ã is mapped back into the pixel space from the latent space as output. In some examples, x0 represents an original input image with low image quality, latent variables x1, . . . , xT represent noisy images, and ã represents the generated image with high image quality.
[0100] FIG. 8 shows an example of a method 800 for merging images according to aspects of the present disclosure. In some examples, these operations are performed by a system including a processor executing a set of codes to control functional elements of an apparatus. Additionally or alternatively, certain processes are performed using special-purpose hardware. Generally, these operations are performed according to the methods and processes described in accordance with aspects of the present disclosure. In some cases, the operations described herein are composed of various substeps, or are performed in conjunction with other operations.
[0101] At operation 805, the system preprocesses the images. In some embodiments, this preprocessing may include rasterizing vector artworks to obtain raster images and standardizing image properties such as resolution and format. In cases where the input images are already in raster format, the rasterization step may be omitted.
[0102] At operation 810, the system segments the images. This may involve performing semantic segmentation on the preprocessed images to identify distinct regions within each image. The segmentation process may divide each image into multiple regions based on semantic information, producing a set of distinct regions for each image.
[0103] At operation 815, the system identifies regions of the same type. The system may analyze the segmented regions and determine which regions from the first image correspond to semantically similar regions in the second image. In some cases, embodiments select background regions or other regions that are suitable candidates for merging.
[0104] At operation 820, the system color matches the regions. For each pair of corresponding regions, the system may extract color information, determine a common color using color perception models (or using the transformation and interpolation operations as described with reference to FIG. 6), and assign this common color to pixels in both regions. According to some aspects, this color harmonization process guides subsequent image generation to create a seamless transition between the two images.
[0105] At operation 825, the system arranges the recolored images. This may involve placing the two processed images side by side with a defined whitespace or gap between them. This arrangement creates the space where the generation model will create transitional content. The space may be input to the image generation model in the form of a binary mask; e.g., the binary mask may be black in areas where the generative model should persist the original content, and white in the interposed area where content should be generated.
[0106] At operation 830, the system generates the merged image. The arranged images with recolored regions may be provided as input to an image generation model, which synthesizes content to fill the gap between the images and create a seamless merged result.
[0107] At operation 835, the system may optionally vectorize the merged image. In embodiments where vector output is desired, this step converts the generated raster image back to vector format. Additional detail regarding a vectorization component is provided with reference to FIG. 2.
[0108] FIG. 9 shows an example of a pipeline for merging images according to aspects of the present disclosure. The example shown includes first image 900, second image 905, segmentation and color adjustment 910, optional weight parameter 915, input conditions 920, image generation model 945, and merged image 950.
[0109] First image region 925 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 6. Second image region 935 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 6. Image generation model 945 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 2. Merged image 950 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 1.
[0110] In this example, a user provides first image 900 and second image 905, which are images to be merged into a larger image that seamlessly incorporates content from both sources. The system first performs segmentation and color adjustment 910, which identifies regions suitable for recoloring based on semantic information, and then recolors those regions to establish color harmony. Additional details regarding these processes are provided with reference to FIG. 6.
[0111] Segmentation and color adjustment 910 generate input conditions 920, which serve as guidance signals for image generation model 945. Input conditions 920 includes first image region 925, region marked for inpainting 930, second image region 935, binary mask 940, and optional weight parameter 915. First image region 925, region marked for inpainting 930, and second image region 935 may be formed into a single input image (or latent spatial map, depending on the configuration of the image generation model 945), while binary mask 940 is provided as an additional input to indicate where new content should be generated. Optional weight parameter 915 corresponds to the a parameter described with reference to FIG. 6, which controls the relative contribution of first image region 925 to the style, coloring, and characteristics of the generated image. As shown in the Figure, image generation model 945 generates merged image 950 that seamlessly integrates first image 900 and second image 905. In this example, merged image 950 includes elements and colors that are more heavily weighted towards first image 900 based on the value of “0.8” for optional weight parameter 915, indicating that the characteristics of the first image have a stronger influence on the final merged result.
[0112] FIG. 10 shows an example of a method 1000 for generating a merged image according to aspects of the present disclosure. In some examples, these operations are performed by a system including a processor executing a set of codes to control functional elements of an apparatus. Additionally or alternatively, certain processes are performed using special-purpose hardware. Generally, these operations are performed according to the methods and processes described in accordance with aspects of the present disclosure. In some cases, the operations described herein are composed of various substeps, or are performed in conjunction with other operations.
[0113] At operation 1005, the system obtains a first image and a second image, where the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color. This operation may involve receiving user-selected images through an interface, accessing images from a database, or processing images from another source. The images may be in various formats, including raster or vector formats, and may contain objects with distinct visual characteristics. In some cases, the operations of this step refer to, or may be performed by, an image processing apparatus as described with reference to FIGS. 1 and 2.
[0114] At operation 1010, the system determines a common color based on the first color and the second color. This determination may involve converting the colors to a perceptual color space, such as CIELAB, where color differences better correspond to human visual perception. In some cases, the operations of this step refer to, or may be performed by, a color matching component as described with reference to FIGS. 2 and 6.
[0115] At operation 1015, the system modifies the first image and the second image based on the common color to obtain a recolored first image and a recolored second image, respectively, where the recolored first image depicts the first object with the common color and the recolored second image depicts the second object with the common color. The recoloring process may preserve other visual characteristics of the objects while adjusting their colors to match the determined common color. In some cases, the operations of this step refer to, or may be performed by, a color matching component as described with reference to FIGS. 2 and 6.
[0116] At operation 1020, the system generates a merged image based on the recolored first image and the recolored second image, where the merged image depicts a combined object with the common color, where the combined object includes at least a portion of the first object and at least a portion of the second object. The generation process may utilize an image generation model, such as a diffusion model, which creates a seamless transition between the recolored objects based on the color adjustments made to the inputs. The resulting combined object incorporates characteristics from both original objects while maintaining visual coherence through the common color. The merged image may preserve the original content from each source image in their respective regions while generating synthetic content in transitional areas. In some cases, the operations of this step refer to, or may be performed by, an image generation model as described with reference to FIGS. 2 and 9.
[0117] FIG. 11 shows an example of merged images according to aspects of the present disclosure. The example shown includes first inputs 1100, first merged image 1105, second inputs 1110, and second merged image 1115.
[0118] The first example shown includes first inputs 1100, which includes an image of a biker traveling up a mountain and another, different biker traveling up a mountain from a different perspective, as well as a binary mask. First merged image 1105 seamlessly joins the two images, resulting in an image that depicts both bikers traveling towards the apex of the mountain. First merged image 1105 includes other elements from both of the inputs including both sky backgrounds and the distant mountains.
[0119] The second example shown includes second inputs 1110 which includes a first image depicting a straw-roofed home and second image depicting a traveling man in a canyon, as well as the binary mask. The second merged image 1115 seamlessly joins content from both images, and matches other regions including the sky. In this example, a user may have input a weight parameter that instructs the system to persist more of the right image, as the sky depicted in the second merged image 1115 more aligns with the right input image.Training
[0120] FIG. 12 is a flow diagram depicting an algorithm as a step-by-step procedure 1200 in an example implementation of operations performable for training a machine-learning model. The procedure 1200 provides one or more examples of generating training data, use of the training data to train a machine-learning model, and use of the trained machine-learning model to perform a task.
[0121] To begin in this example, a machine-learning system collects training data (block 1202) that is to be used as a basis to train a machine-learning model, i.e., which defines what is being modeled. The training data is collectable by the machine-learning system from a variety of sources. Examples of training data sources include public datasets, service provider system platforms that expose application programming interfaces (e.g., social media platforms), user data collection systems (e.g., digital surveys and online crowdsourcing systems), and so forth. Training data collection may also include data augmentation and synthetic data generation techniques to expand and diversify available training data, balancing techniques to balance a number of positive and negative examples, and so forth.
[0122] The machine-learning system is also configurable to identify features that are relevant (block 1204) to a type of task, for which, the machine-learning model is to be trained. Task examples include classification, natural language processing, generative artificial intelligence, recommendation engines, reinforcement learning, clustering, and so forth. To do so, the machine-learning system collects the training data based on the identified features and / or filters the training data based on the identified features after collection. The training data is then utilized to train a machine-learning model.
[0123] In order to train the machine-learning model in the illustrated example, the machine-learning model is first initialized (block 1206). Initialization of the machine-learning model includes selecting a model architecture (block 1208) to be trained. Examples of model architectures include neural networks, convolutional neural networks (CNNs), long short-term memory (LSTM) neural networks, transformer networks, generative adversarial networks (GANs), decision trees, support vector machines, linear regression, logistic regression, Bayesian networks, random forest learning, dimensionality reduction algorithms, boosting algorithms, deep learning neural networks, etc.
[0124] A loss function is also selected (block 1210). The loss function is utilized to measure a difference between an output of the machine-learning model (i.e., predictions) and target values (e.g., as expressed by the training data) to be used to train the machine-learning model. Additionally, an optimization algorithm is selected (1212) that is to be used in conjunction with the loss function to optimize parameters of the machine-learning model during training, examples of which include gradient descent, stochastic gradient descent (SGD), and so forth.
[0125] Initialization of the machine-learning model further includes setting initial values of the machine-learning model (block 1214) examples of which includes initializing weights and biases of nodes to improve efficiency in training and computational resources consumption as part of training. Hyperparameters are also set that are used to control training of the machine learning model, examples of which include regularization parameters, model parameters (e.g., a number of layers in a neural network), learning rate, batch sizes selected from the training data, and so on. The hyperparameters are set using a variety of techniques, including use of a randomization technique, through use of heuristics learned from other training scenarios, and so forth.
[0126] The machine-learning model is then trained using the training data (block 1218) by the machine-learning system. A machine-learning model refers to a computer representation that can be tuned (e.g., trained and retrained) based on inputs of the training data to approximate unknown functions. In particular, the term machine-learning model can include a model that utilizes algorithms (e.g., using the model architectures described above) to learn from, and make predictions on, known data by analyzing training data to learn and relearn to generate outputs that reflect patterns and attributes expressed by the training data.
[0127] Examples of training types include supervised learning that employs labeled data, unsupervised learning that involves finding underlying structures or patterns within the training data, reinforcement learning based on optimization functions (e.g., rewards and / or penalties), use of nodes as part of “deep learning,” and so forth. The machine-learning model, for instance, is configurable as including a plurality of nodes that collectively form a plurality of layers. The layers, for instance, are configurable to include an input layer, an output layer, and one or more hidden layers. Calculations are performed by the nodes within the layers through the hidden states through a system of weighted connections that are “learned” during training, e.g., through use of the selected loss function and backpropagation to optimize performance of the machine-learning model to perform an associated task.
[0128] As part of training the machine-learning model, a determination is made as to whether a stopping criterion is met (decision block 1220), i.e., which is used to validate the machine-learning model. The stopping criterion is usable to reduce overfitting of the machine-learning model, reduce computational resource consumption, and promote an ability of the machine-learning model to address previously unseen data, i.e., that is not included specifically as an example in the training data. Examples of a stopping criterion include but are not limited to a predefined number of epochs, validation loss stabilization, achievement of a performance improvement threshold, whether a threshold level of accuracy has been met, or based on performance metrics such as precision and recall. If the stopping criterion has not been met (“no” from decision block 1220), the procedure 1200 continues training of the machine-learning model using the training data (block 1218) in this example.
[0129] If the stopping criterion is met (“yes” from decision block 1220), the trained machine-learning model is then utilized to generate an output based on subsequent data (block 1222). The trained machine-learning model, for instance, is trained to perform a task as described above and therefore once trained is configured to perform that task based on subsequent data received as an input and processed by the machine-learning model.
[0130] FIG. 13 shows an example of a pipeline for training a segmentation component according to aspects of the present disclosure. The example shown includes database 1300, segmented and labeled realistic images 1305, training component 1310, segmentation model 1330, predicted segmentations 1335, and training loss 1340.
[0131] Database 1300 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 1. Training component 1310 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 2. Segmentation model 1330 is an example of, or includes aspects of, the corresponding element described with reference to FIG. 2.
[0132] In this example pipeline, the system obtains a dataset of realistic images (e.g., images that may have plausibly been taken by a camera system without further editing), transforms the realistic images into vectorizable images, and uses the vectorizable images to finetune a segmentation model. The realistic images may have been previously labeled using, e.g., expert annotators, and the vectorizable images may have the labels removed but may contain the same or similar elements with located in the same regions as the original images. The segmentation model processes the vectorizable images to predict regions and labels for the regions, and the training process computes a segmentation loss based on the differences from the ground-truth labels from the original images and uses the segmentation loss to update parameters of the segmentation model via e.g., backpropagation of the loss to the parameters of the model.
[0133] In this example, training component 1310 receives segmented and labeled realistic images 1305 from database 1300. These images serve as ground-truth data for training the segmentation model and are used to accurately identify regions in vectorizable images, which will be generated from the realistic images. In one aspect, training component 1310 performs vectorization 1315 and data augmentation 1320 on the input data, such as segmented and labeled realistic images 1305, to generate vectorizable images 1325.
[0134] Vectorization 1315 transforms the realistic images into images with vectorizable characteristics, such as flat color regions, clearly defined boundaries, and reduced gradients. This transformation may apply techniques including edge detection, color quantization, and contour tracing to create images that resemble vector artwork while preserving the essential semantic content and structure of the original images.
[0135] Data augmentation 1320 increases the diversity of the training data by applying various transformations to the vectorized images. These transformations may include random cropping, rotation, scaling, flipping, and color adjustments. This process helps improve the robustness of the segmentation model by exposing it to variations that might occur in real-world vectorizable image.
[0136] The resulting vectorizable images 1325 maintain the same semantic content as the original realistic images but depict a style more consistent with the domain of vector artwork. The vectorizable images retain the original ground-truth segmentation labels from segmented and labeled realistic images 1305, thereby enabling supervised training of the segmentation model.
[0137] Segmentation model 1330 processes vectorizable images 1325 to generate predicted segmentations 1335. These predictions represent the model's attempt to identify and label the different regions within the vectorizable images. The system then compares these predictions against the original ground-truth segmentation labels to compute training loss 1340.
[0138] Training loss 1340 quantifies the discrepancy between the predicted segmentations and the ground-truth labels. Common metrics for this loss may include pixel-wise cross-entropy loss or Intersection over Union (IoU) based metrics. Using this loss value, training component 1310 updates the parameters of segmentation model 1330 through backpropagation and optimization techniques such as stochastic gradient descent or Adam optimization.
[0139] Through iterative training with vectorizable images 1325, segmentation model 1330 gradually learns to accurately segment and label regions in vectorizable images, even though it was initially trained on realistic images. This domain adaptation approach enables the model to perform effectively on the types of images that may be processed during the image merging operations described throughout this disclosure.
[0140] FIG. 14 shows an example of a method 1400 for training a diffusion model according to aspects of the present disclosure. In some embodiments, the method 1400 describes an operation for configuring the image generation model 230 as described with reference to FIG. 2. The method 1400 represents an example for training a reverse diffusion process as described above with reference to FIG. 7. In some examples, these operations are performed by a system including a processor executing a set of codes to control functional elements of an apparatus, such as the guided diffusion model described in FIG. 3.
[0141] Additionally or alternatively, certain processes of method 1400 may be performed using special-purpose hardware. Generally, these operations are performed according to the methods and processes described in accordance with aspects of the present disclosure. In some cases, the operations described herein are composed of various substeps, or are performed in conjunction with other operations.
[0142] At operation 1405, the user initializes an untrained model. Initialization can include defining the architecture of the model and establishing initial values for the model parameters. In some cases, the initialization can include defining hyper-parameters such as the number of layers, the resolution and channels of each layer blocks, the location of skip connections, and the like.
[0143] At operation 1410, the system adds noise to a training image using a forward diffusion process in N stages. In some cases, the forward diffusion process is a fixed process where Gaussian noise is successively added to an image. In latent diffusion models, the Gaussian noise may be successively added to features in a latent space.
[0144] At operation 1415, the system at each stage n, starting with stage N, a reverse diffusion process is used to predict the image or image features at stage n−1. For example, the reverse diffusion process can predict the noise that was added by the forward diffusion process, and the predicted noise can be removed from the image to obtain the predicted image. In some cases, an original image is predicted at each stage of the training process.
[0145] At operation 1420, the system compares predicted image (or image features) at stage n−1 to an actual image (or image features), such as the image at stage n−1 or the original input image. For example, given observed data x, the diffusion model may be trained to minimize the variational upper bound of the negative log-likelihood-log pθ(x) of the training data.
[0146] At operation 1425, the system updates parameters of the model based on the comparison. For example, parameters of a U-Net may be updated using gradient descent. Time-dependent parameters of the Gaussian transitions can also be learned.
[0147] FIG. 15 shows an example of a computing device 1500 according to aspects of the present disclosure. The example shown includes computing device 1500, processor(s) 1505, memory subsystem 1510, communication interface 1515, I / O interface 1520, user interface component(s), and channel 1530.
[0148] In some embodiments, computing device 1500 is an example of, or includes aspects of, an image processing apparatus as described in FIGS. 1 and 2. In some embodiments, computing device 1500 includes one or more processors 1505 are configured to execute instructions stored in memory subsystem 1510 to obtain a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color; determine a common color based on the first color and the second color; modify the first image and the second image based on the common color to obtain a recolored first image and a recolored second image, respectively, wherein the recolored first image depicts the first object with the common color and the recolored second image depicts the second object with the common color; and generate, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object with the common color, wherein the combined object includes at least a portion of the first object and at least a portion of the second object.
[0149] According to some aspects, computing device 1500 includes one or more processors 1505. In some cases, a processor is an intelligent hardware device, (e.g., a general-purpose processing component, a digital signal processor (DSP), a central processing unit (CPU), a graphics processing unit (GPU), a microcontroller, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, or a combination thereof. In some cases, a processor is configured to operate a memory array using a memory controller. In other cases, a memory controller is integrated into a processor. In some cases, a processor is configured to execute computer-readable instructions stored in a memory to perform various functions. In some embodiments, a processor includes special purpose components for modem processing, baseband processing, digital signal processing, or transmission processing.
[0150] According to some aspects, memory subsystem 1510 includes one or more memory devices. Examples of a memory device include random access memory (RAM), read-only memory (ROM), or a hard disk. Examples of memory devices include solid state memory and a hard disk drive. In some examples, memory is used to store computer-readable, computer-executable software including instructions that, when executed, cause a processor to perform various functions described herein. The memory may store model parameters in the form of tensors which, when combined with mathematical operations such as matrix multiplications, implement machine learning models specially configured to perform specific tasks. These parameters may correspond to the models described with reference to FIG. 2. In some cases, the memory contains, among other things, a basic input / output system (BIOS) which controls basic hardware or software operation such as the interaction with peripheral components or devices. In some cases, a memory controller operates memory cells. For example, the memory controller can include a row decoder, column decoder, or both. In some cases, memory cells within a memory store information in the form of a logical state.
[0151] According to some aspects, communication interface 1515 operates at a boundary between communicating entities (such as computing device 1500, one or more user devices, a cloud, and one or more databases) and channel 1530 and can record and process communications. In some cases, communication interface 1515 is provided to enable a processing system coupled to a transceiver (e.g., a transmitter and / or a receiver). In some examples, the transceiver is configured to transmit (or send) and receive signals for a communications device via an antenna.
[0152] According to some aspects, I / O interface 1520 is controlled by an I / O controller to manage input and output signals for computing device 1500. In some cases, I / O interface 1520 manages peripherals not integrated into computing device 1500. In some cases, I / O interface 1520 represents a physical connection or port to an external peripheral. In some cases, the I / O controller uses an operating system such as iOS®, ANDROID®, MS-DOS®, MS-WINDOWS®, OS / 2®, UNIX®, LINUX®, or other known operating system. In some cases, the I / O controller represents or interacts with a modem, a keyboard, a mouse, a touchscreen, or a similar device. In some cases, the I / O controller is implemented as a component of a processor. In some cases, a user interacts with a device via I / O interface 1520 or via hardware components controlled by the I / O controller.
[0153] According to some aspects, user interface component(s) 1525 enable a user to interact with computing device 1500. In some cases, user interface component(s) 1525 include an audio device, such as an external speaker system, an external display device such as a display screen, an input device (e.g., a remote control device interfaced with a user interface directly or through the I / O controller), or a combination thereof. In some cases, user interface component(s) 1525 include a GUI.
[0154] Accordingly, the present disclosure includes the following aspects.
[0155] A method for image combination is described. One or more aspects of the method include obtaining a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color; determining a common color based on the first color and the second color; modifying the first image and the second image based on the common color to obtain a recolored first image and a recolored second image, respectively, wherein the recolored first image depicts the first object with the common color and the recolored second image depicts the second object with the common color; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object with the common color, wherein the combined object includes at least a portion of the first object and at least a portion of the second object.
[0156] Some examples of the method, apparatus, non-transitory computer readable medium, and system further include segmenting the first image to identify the first object. Some examples further include segmenting the second image to identify the second object. In some aspects, the first image and the second image are segmented using a segmentation model trained on vectorizable images.
[0157] Some examples of the method, apparatus, non-transitory computer readable medium, and system further include determining that the first object and the second object have a same category, wherein the common color is determined based on the first object and the second object having the same category. Some examples further include converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively. Some examples further include interpolating between the converted first color and the converted second color to obtain the common color.
[0158] In some aspects, the merged image includes first original content from the first image in a first region corresponding to the first image, second original content from the second image in a second region corresponding to the second image, and synthetic content in a third region located between the first region and the second region. Some examples of the method, apparatus, non-transitory computer readable medium, and system further include performing a diffusion process based on the first recolored image and the second recolored image. Some examples further include converting the first image and the second image from an RGB color space to a perceptual color space.
[0159] A method for image combination is described. One or more aspects of the method include obtaining a first image and a second image; segmenting the first image and the second image, respectively, to identify a first object with a first color and a second object with a second color, wherein the first object and the second object have a same category; modifying the first image and the second image by recoloring the first object and the second object to obtain a recolored first image and a recolored second image, respectively; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object that includes at least a portion of the first object and at least a portion of the second object.
[0160] In some aspects, the image generation model performs a diffusion process based on the first recolored image and the second recolored image to generate the merged image. In some aspects, the first image and the second image are segmented using a segmentation model trained on vectorizable images.
[0161] Some examples of the method, apparatus, non-transitory computer readable medium, and system further include determining a common color based on the first color and the second color, wherein the recolored first image depicts the first object with the common color and wherein the recolored second image depicts the second object with the common color. Some examples further include determining that the first object and the second object have a same category, wherein the common color is determined based on the first object and the second object having the same category.
[0162] Some examples of the method, apparatus, non-transitory computer readable medium, and system further include converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively. Some examples further include interpolating between the converted first color and the converted second color to obtain the common color. In some aspects, the merged image includes first original content from the first image in a first region corresponding to the first image, second original content from the second image in a second region corresponding to the second image, and synthetic content in a third region located between the first region and the second region.
[0163] A system for image combination is described. One or more aspects of the apparatus include a memory component; a processing device coupled to the memory component, the processing device configured to perform operations comprising; obtaining a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color; determining a common color based on the first color and the second color; modifying the first image and the second image based on the common color to obtain a recolored first image and a recolored second image, respectively, wherein the recolored first image depicts the first object with the common color and the recolored second image depicts the second object with the common color; and generating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object with the common color, wherein the combined object includes at least a portion of the first object and at least a portion of the second object.
[0164] Some examples of the apparatus, system, and method further include a segmentation model configured to segment the first image to identify the first object. Some examples further include determining that the first object and the second object have a same category, wherein the common color is determined based on the first object and the second object having the same category. Some examples further include converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively. Some examples further include interpolating between the converted first color and the converted second color to obtain the common color. In some aspects, the image generation model comprises a diffusion model.
[0165] The description and drawings described herein represent example configurations and do not represent all the implementations within the scope of the claims. For example, the operations and steps may be rearranged, combined or otherwise modified. Also, structures and devices may be represented in the form of block diagrams to represent the relationship between components and avoid obscuring the described concepts. Similar components or features may have the same name but may have different reference numbers corresponding to different figures.
[0166] Some modifications to the disclosure may be readily apparent to those skilled in the art, and the principles defined herein may be applied to other variations without departing from the scope of the disclosure. Thus, the disclosure is not limited to the examples and designs described herein, but is to be accorded the broadest scope consistent with the principles and novel features disclosed herein.
[0167] The described methods may be implemented or performed by devices that include a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. A general-purpose processor may be a microprocessor, a conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices (e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration). Thus, the functions described herein may be implemented in hardware or software and may be executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored in the form of instructions or code on a computer-readable medium.
[0168] Computer-readable media includes both non-transitory computer storage media and communication media including any medium that facilitates transfer of code or data. A non-transitory storage medium may be any available medium that can be accessed by a computer. For example, non-transitory computer-readable media can comprise random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), compact disk (CD) or other optical disk storage, magnetic disk storage, or any other non-transitory medium for carrying or storing data or code.
[0169] Also, connecting components may be properly termed computer-readable media. For example, if code or data is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technology such as infrared, radio, or microwave signals, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technology are included in the definition of medium. Combinations of media are also included within the scope of computer-readable media.
[0170] In this disclosure and the following claims, the word “or” indicates an inclusive list such that, for example, the list of X, Y, or Z means X or Y or Z or XY or XZ or YZ or XYZ. Also the phrase “based on” is not used to represent a closed set of conditions. For example, a step that is described as “based on condition A” may be based on both condition A and condition B. In other words, the phrase “based on” shall be construed to mean “based at least in part on.” Also, the words “a” or “an” indicate “at least one.”
Claims
1. A method comprising:obtaining a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color;modifying the first image and the second image to obtain a recolored first image and a recolored second image, respectively; andgenerating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object that includes at least a portion of the first object and at least a portion of the second object.
2. The method of claim 1, further comprising:determining a common color based on the first color and the second color, wherein the recolored first image depicts the first object with the common color, the recolored second image depicts the second object with the common color, and the merged image depicts the combined object with the common color.
3. The method of claim 1, further comprising:segmenting the first image to identify the first object; andsegmenting the second image to identify the second object.
4. The method of claim 1, further comprising:determining that the first object and the second object have a same category; anddetermining a common color for the first object and the second object based on the first object and the second object having the same category.
5. The method of claim 1, further comprising:converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively; andinterpolating between the converted first color and the converted second color to obtain a common color.
6. The method of claim 1, wherein:the merged image includes first original content from the first image in a first region corresponding to the first image, second original content from the second image in a second region corresponding to the second image, and synthetic content in a third region located between the first region and the second region.
7. The method of claim 1, wherein generating the merged image comprises:performing a diffusion process based on the first recolored image and the second recolored image.
8. The method of claim 1, further comprising:converting the first image and the second image from an RGB color space to a perceptual color space.
9. A non-transitory computer readable medium storing code, the code comprising instructions that, when executed by at least one processor, cause the at least one processor to perform operations comprising:obtaining a first image including a first object and a second image including a second object;modifying the first image and the second image by recoloring the first object and the second object to obtain a recolored first image and a recolored second image, respectively; andgenerating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object based on the first object and the second object.
10. The non-transitory computer readable medium of claim 9, wherein:the image generation model performs a diffusion process based on the first recolored image and the second recolored image to generate the merged image.
11. The non-transitory computer readable medium of claim 9, wherein:the first image and the second image are segmented to identify the first object and the second object.
12. The non-transitory computer readable medium of claim 9, the code further comprising instructions that, when executed by the at least one processor, cause the at least one processor to perform operations comprising:determining a common color based on a first color of the first object and a second color of the second object, wherein the recolored first image depicts the first object with the common color and wherein the recolored second image depicts the second object with the common color.
13. The non-transitory computer readable medium of claim 12, the code further comprising instructions that, when executed by the at least one processor, cause the at least one processor to perform operations comprising:determining that the first object and the second object have a same category, wherein the common color is determined based on the first object and the second object having the same category.
14. The non-transitory computer readable medium of claim 12, wherein determining the common color comprises:converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively; andinterpolating between the converted first color and the converted second color to obtain the common color.
15. The non-transitory computer readable medium of claim 9, wherein:the merged image includes first original content from the first image in a first region corresponding to the first image, second original content from the second image in a second region corresponding to the second image, and synthetic content in a third region located between the first region and the second region.
16. A system for image processing, comprising:a memory component;a processing device coupled to the memory component, the processing device configured to perform operations comprising:obtaining a first image and a second image, wherein the first image depicts a first object with a first color and the second image depicts a second object with a second color different from the first color;modifying the first image and the second image to obtain a recolored first image and a recolored second image, respectively; andgenerating, using an image generation model, a merged image based on the recolored first image and the recolored second image, wherein the merged image depicts a combined object that includes at least a portion of the first object and at least a portion of the second object.
17. The system of claim 16, the system further comprising:a segmentation model configured to segment the first image to identify the first object.
18. The system of claim 16, the processing device being further configured to perform operations comprising:determining that the first object and the second object have a same category; anddetermining a common color for the first object and the second object based on the determination that the first object and the second object have the same category.
19. The system of claim 16, the processing device being further configured to perform operations comprising:converting the first color and the second color into a perceptual color space to obtain a converted first color and a converted second color, respectively; andinterpolating between the converted first color and the converted second color to obtain a common color.
20. The system of claim 16, wherein:the image generation model comprises a diffusion model.
