• dg845's avatar
    [WIP] Refactor UniDiffuser Pipeline and Tests (#4948) · cd1b8d7c
    dg845 authored
    
    
    * Add VAE slicing and tiling methods.
    
    * Switch to using VaeImageProcessing for preprocessing and postprocessing of images.
    
    * Rename the VaeImageProcessor to vae_image_processor to avoid a name clash with the CLIPImageProcessor (image_processor).
    
    * Remove the postprocess() function because we're using a VaeImageProcessor instead.
    
    * Remove UniDiffuserPipeline.decode_image_latents because we're using VaeImageProcessor instead.
    
    * Refactor generating text from text latents into a decode_text_latents method.
    
    * Add enable_full_determinism() to UniDiffuser tests.
    
    * make style
    
    * Add PipelineLatentTesterMixin to UniDiffuserPipelineFastTests.
    
    * Remove enable_model_cpu_offload since it is now part of DiffusionPipeline.
    
    * Rename the VaeImageProcessor instance to self.image_processor for consistency with other pipelines and rename the CLIPImageProcessor instance to clip_image_processor to avoid a name clash.
    
    * Update UniDiffuser conversion script.
    
    * Make safe_serialization configurable in UniDiffuser conversion script.
    
    * Rename image_processor to clip_image_processor in UniDiffuser tests.
    
    * Add PipelineKarrasSchedulerTesterMixin to UniDiffuserPipelineFastTests.
    
    * Add initial test for compiling the UniDiffuser model (not tested yet).
    
    * Update encode_prompt and _encode_prompt to match that of StableDiffusionPipeline.
    
    * Turn off standard classifier-free guidance for now.
    
    * make style
    
    * make fix-copies
    
    * apply suggestions from review
    
    ---------
    Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
    cd1b8d7c
convert_unidiffuser_to_diffusers.py 30.7 KB