


import gc
import random
import tempfile
import unittest

import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import AutoencoderKL, DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler, UNetaDConditionModel
from diffusers.pipelines.stable_diffusion_safe import StableDiffusionPipelineSafe as StableDiffusionPipeline
from diffusers.utils import floats_tensor, nightly, torch_device
from diffusers.utils.testing_utils import require_torch_gpu







class 	__lowercase    (unittest.TestCase  ):





							"""simple docstring"""







							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										super().tearDown()
										gc.collect()
										torch.cuda.empty_cache()






							@property
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Tuple					=					1
										SCREAMING_SNAKE_CASE_		:     str					=					3
										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					(3_2, 3_2)

										SCREAMING_SNAKE_CASE_		:     str					=					floats_tensor((batch_size, num_channels) + sizes			,						rng=random.Random(0       )       ).to(_lowercase       )
										return image






							@property
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										torch.manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					UNetaDConditionModel(
										    block_out_channels=(3_2, 6_4)			,						layers_per_block=2			,						sample_size=3_2			,						in_channels=4			,						out_channels=4			,						down_block_types=('DownBlock2D', 'CrossAttnDownBlock2D')			,						up_block_types=('CrossAttnUpBlock2D', 'UpBlock2D')			,						cross_attention_dim=3_2			,						)
										return model






							@property
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										torch.manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					AutoencoderKL(
										    block_out_channels=[3_2, 6_4]			,						in_channels=3			,						out_channels=3			,						down_block_types=['DownEncoderBlock2D', 'DownEncoderBlock2D']			,						up_block_types=['UpDecoderBlock2D', 'UpDecoderBlock2D']			,						latent_channels=4			,						)
										return model






							@property
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										torch.manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					CLIPTextConfig(
										    bos_token_id=0			,						eos_token_id=2			,						hidden_size=3_2			,						intermediate_size=3_7			,						layer_norm_eps=1E-05			,						num_attention_heads=4			,						num_hidden_layers=5			,						pad_token_id=1			,						vocab_size=1_0_0_0			,						)
										return CLIPTextModel(_lowercase       )






							@property
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										def extract(*lowerCAmelCase__			,						**lowerCAmelCase__       ):







													class 	__lowercase    :





																				"""simple docstring"""







																				def __init__(      self       ):





																							"""simple docstring"""




																							SCREAMING_SNAKE_CASE_		:     Tuple					=					torch.ones([0]       )






																				def 					UpperCamelCase__     (      self			,						lowerCAmelCase__       ):





																							"""simple docstring"""




																							self.pixel_values.to(_lowercase       )
																							return self







													return Out()

										return extract






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     List[str]					=					'cpu'  # ensure determinism for the device-dependent torch.Generator
										SCREAMING_SNAKE_CASE_		:     Tuple					=					self.dummy_cond_unet
										SCREAMING_SNAKE_CASE_		:     Dict					=					DDIMScheduler(
										    beta_start=0.00_085			,						beta_end=0.012			,						beta_schedule='scaled_linear'			,						clip_sample=_lowercase			,						set_alpha_to_one=_lowercase			,						)

										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					self.dummy_vae
										SCREAMING_SNAKE_CASE_		:     Dict					=					self.dummy_text_encoder
										SCREAMING_SNAKE_CASE_		:     List[str]					=					CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'       )

										# make sure here that pndm scheduler skips prk
										SCREAMING_SNAKE_CASE_		:     int					=					StableDiffusionPipeline(
										    unet=_lowercase			,						scheduler=_lowercase			,						vae=_lowercase			,						text_encoder=_lowercase			,						tokenizer=_lowercase			,						safety_checker=_lowercase			,						feature_extractor=self.dummy_extractor			,						)
										SCREAMING_SNAKE_CASE_		:     int					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     Any					=					'A painting of a squirrel eating a burger'

										SCREAMING_SNAKE_CASE_		:     int					=					torch.Generator(device=_lowercase       ).manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					sd_pipe([prompt]			,						generator=_lowercase			,						guidance_scale=6.0			,						num_inference_steps=2			,						output_type='np'       )
										SCREAMING_SNAKE_CASE_		:     Any					=					output.images

										SCREAMING_SNAKE_CASE_		:     List[str]					=					torch.Generator(device=_lowercase       ).manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=6.0			,						num_inference_steps=2			,						output_type='np'			,						return_dict=_lowercase			,						)[0]

										SCREAMING_SNAKE_CASE_		:     List[str]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     List[str]					=					image_from_tuple[0, -3:, -3:, -1]

										assert image.shape == (1, 6_4, 6_4, 3)
										SCREAMING_SNAKE_CASE_		:     Dict					=					np.array([0.5_756, 0.6_118, 0.5_005, 0.5_041, 0.5_471, 0.4_726, 0.4_976, 0.4_865, 0.4_864]       )

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2
										assert np.abs(image_from_tuple_slice.flatten() - expected_slice       ).max() < 1E-2






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Tuple					=					'cpu'  # ensure determinism for the device-dependent torch.Generator
										SCREAMING_SNAKE_CASE_		:     int					=					self.dummy_cond_unet
										SCREAMING_SNAKE_CASE_		:     Tuple					=					PNDMScheduler(skip_prk_steps=_lowercase       )
										SCREAMING_SNAKE_CASE_		:     Tuple					=					self.dummy_vae
										SCREAMING_SNAKE_CASE_		:     Dict					=					self.dummy_text_encoder
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'       )

										# make sure here that pndm scheduler skips prk
										SCREAMING_SNAKE_CASE_		:     Any					=					StableDiffusionPipeline(
										    unet=_lowercase			,						scheduler=_lowercase			,						vae=_lowercase			,						text_encoder=_lowercase			,						tokenizer=_lowercase			,						safety_checker=_lowercase			,						feature_extractor=self.dummy_extractor			,						)
										SCREAMING_SNAKE_CASE_		:     List[str]					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     int					=					'A painting of a squirrel eating a burger'
										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					torch.Generator(device=_lowercase       ).manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					sd_pipe([prompt]			,						generator=_lowercase			,						guidance_scale=6.0			,						num_inference_steps=2			,						output_type='np'       )

										SCREAMING_SNAKE_CASE_		:     List[Any]					=					output.images

										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					torch.Generator(device=_lowercase       ).manual_seed(0       )
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=6.0			,						num_inference_steps=2			,						output_type='np'			,						return_dict=_lowercase			,						)[0]

										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					image_from_tuple[0, -3:, -3:, -1]

										assert image.shape == (1, 6_4, 6_4, 3)
										SCREAMING_SNAKE_CASE_		:     Dict					=					np.array([0.5_125, 0.5_716, 0.4_828, 0.5_060, 0.5_650, 0.4_768, 0.5_185, 0.4_895, 0.4_993]       )

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2
										assert np.abs(image_from_tuple_slice.flatten() - expected_slice       ).max() < 1E-2






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					StableDiffusionPipeline.from_pretrained(
										    'hf-internal-testing/tiny-stable-diffusion-lms-pipe'			,						safety_checker=_lowercase       )
										assert isinstance(_lowercase			,						_lowercase       )
										assert isinstance(pipe.scheduler			,						_lowercase       )
										assert pipe.safety_checker is None

										SCREAMING_SNAKE_CASE_		:     List[Any]					=					pipe('example prompt'			,						num_inference_steps=2       ).images[0]
										assert image is not None

										# check that there's no error when saving a pipeline with one of the models being None
										with tempfile.TemporaryDirectory() as tmpdirname:
													pipe.save_pretrained(_lowercase       )
													SCREAMING_SNAKE_CASE_		:     Tuple					=					StableDiffusionPipeline.from_pretrained(_lowercase       )

										# sanity check that the pipeline still works
										assert pipe.safety_checker is None
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					pipe('example prompt'			,						num_inference_steps=2       ).images[0]
										assert image is not None






							@unittest.skipIf(torch_device != 'cuda'			,						'This test requires a GPU'       )
							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Dict					=					self.dummy_cond_unet
										SCREAMING_SNAKE_CASE_		:     str					=					PNDMScheduler(skip_prk_steps=_lowercase       )
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					self.dummy_vae
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					self.dummy_text_encoder
										SCREAMING_SNAKE_CASE_		:     Any					=					CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'       )

										# put models in fp16
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					unet.half()
										SCREAMING_SNAKE_CASE_		:     str					=					vae.half()
										SCREAMING_SNAKE_CASE_		:     List[str]					=					bert.half()

										# make sure here that pndm scheduler skips prk
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					StableDiffusionPipeline(
										    unet=_lowercase			,						scheduler=_lowercase			,						vae=_lowercase			,						text_encoder=_lowercase			,						tokenizer=_lowercase			,						safety_checker=_lowercase			,						feature_extractor=self.dummy_extractor			,						)
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     int					=					'A painting of a squirrel eating a burger'
										SCREAMING_SNAKE_CASE_		:     Any					=					sd_pipe([prompt]			,						num_inference_steps=2			,						output_type='np'       ).images

										assert image.shape == (1, 6_4, 6_4, 3)







@nightly
@require_torch_gpu
class 	__lowercase    (unittest.TestCase  ):





							"""simple docstring"""







							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										super().tearDown()
										gc.collect()
										torch.cuda.empty_cache()






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Any					=					StableDiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5'			,						safety_checker=_lowercase       )
										SCREAMING_SNAKE_CASE_		:     Tuple					=					LMSDiscreteScheduler.from_config(sd_pipe.scheduler.config       )
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					(
										    'portrait of girl with smokey eyes makeup in abandoned hotel, grange clothes, redshift, wide high angle'
										    ' coloured polaroid photograph with flash, kodak film, hyper real, stunning moody cinematography, with'
										    ' anamorphic lenses, by maripol, fallen angels by wong kar - wai, style of suspiria and neon demon and'
										    ' children from bahnhof zoo, detailed '
										)
										SCREAMING_SNAKE_CASE_		:     str					=					4_0_0_3_6_6_0_3_4_6
										SCREAMING_SNAKE_CASE_		:     str					=					7

										# without safety guidance (sld_guidance_scale = 0)
										SCREAMING_SNAKE_CASE_		:     int					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     int					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=0			,						)

										SCREAMING_SNAKE_CASE_		:     Dict					=					output.images
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     int					=					[0.2_278, 0.2_231, 0.2_249, 0.2_333, 0.2_303, 0.1_885, 0.2_273, 0.2_144, 0.2_176]

										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2

										# without safety guidance (strong configuration)
										SCREAMING_SNAKE_CASE_		:     List[str]					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     List[str]					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=2_0_0_0			,						sld_warmup_steps=7			,						sld_threshold=0.025			,						sld_momentum_scale=0.5			,						sld_mom_beta=0.7			,						)

										SCREAMING_SNAKE_CASE_		:     Dict					=					output.images
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					[0.2_383, 0.2_276, 0.236, 0.2_192, 0.2_186, 0.2_053, 0.1_971, 0.1_901, 0.1_719]

										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					StableDiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5'			,						safety_checker=_lowercase       )
										SCREAMING_SNAKE_CASE_		:     int					=					LMSDiscreteScheduler.from_config(sd_pipe.scheduler.config       )
										SCREAMING_SNAKE_CASE_		:     int					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     Dict					=					'padme amidala taking a bath artwork, safe for work, no nudity'
										SCREAMING_SNAKE_CASE_		:     Tuple					=					2_7_3_4_9_7_1_7_5_5
										SCREAMING_SNAKE_CASE_		:     int					=					7

										SCREAMING_SNAKE_CASE_		:     List[str]					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     List[str]					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=0			,						)

										SCREAMING_SNAKE_CASE_		:     str					=					output.images
										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					[0.3_502, 0.3_622, 0.3_396, 0.3_642, 0.3_478, 0.3_318, 0.35, 0.3_348, 0.3_297]

										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2

										SCREAMING_SNAKE_CASE_		:     Tuple					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     Tuple					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=2_0_0_0			,						sld_warmup_steps=7			,						sld_threshold=0.025			,						sld_momentum_scale=0.5			,						sld_mom_beta=0.7			,						)

										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					output.images
										SCREAMING_SNAKE_CASE_		:     List[str]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     Optional[int]					=					[0.5_531, 0.5_206, 0.4_895, 0.5_156, 0.5_182, 0.4_751, 0.4_802, 0.4_803, 0.4_443]

										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2






							def 					UpperCamelCase__     (      self       ):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					StableDiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5'       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					sd_pipe.to(_lowercase       )
										sd_pipe.set_progress_bar_config(disable=_lowercase       )

										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					(
										    'the four horsewomen of the apocalypse, painting by tom of finland, gaston bussiere, craig mullins, j. c.'
										    ' leyendecker'
										)
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					1_0_4_4_3_5_5_2_3_4
										SCREAMING_SNAKE_CASE_		:     List[str]					=					1_2

										SCREAMING_SNAKE_CASE_		:     Dict					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     Any					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=0			,						)

										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					output.images
										SCREAMING_SNAKE_CASE_		:     Tuple					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]       )

										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-7

										SCREAMING_SNAKE_CASE_		:     str					=					torch.manual_seed(_lowercase       )
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					sd_pipe(
										    [prompt]			,						generator=_lowercase			,						guidance_scale=_lowercase			,						num_inference_steps=5_0			,						output_type='np'			,						width=5_1_2			,						height=5_1_2			,						sld_guidance_scale=2_0_0_0			,						sld_warmup_steps=7			,						sld_threshold=0.025			,						sld_momentum_scale=0.5			,						sld_mom_beta=0.7			,						)

										SCREAMING_SNAKE_CASE_		:     Any					=					output.images
										SCREAMING_SNAKE_CASE_		:     List[str]					=					image[0, -3:, -3:, -1]
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					np.array([0.5_818, 0.6_285, 0.6_835, 0.6_019, 0.625, 0.6_754, 0.6_096, 0.6_334, 0.6_561]       )
										assert image.shape == (1, 5_1_2, 5_1_2, 3)

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1E-2







'''simple docstring'''



from manim import *




class     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''simple docstring'''






						def    _lowercase      (   self ):

												"""simple docstring"""



												_lowerCAmelCase    		=					Rectangle(height=0.5       ,  width=0.5 )
												_lowerCAmelCase    		=					Rectangle(height=0.46       ,  width=0.46 ).set_stroke(width=0 )

												_lowerCAmelCase    		=					[mem.copy() for i in range(6 )]
												_lowerCAmelCase    		=					[mem.copy() for i in range(6 )]
												_lowerCAmelCase    		=					VGroup(*_lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					VGroup(*_lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					VGroup(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					Text("""CPU"""       ,  font_size=24 )
												_lowerCAmelCase    		=					Group(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0.5       ,  aligned_edge=_lowercase )
												cpu.move_to([-2.5, -0.5, 0] )
												self.add(_lowercase )

												_lowerCAmelCase    		=					[mem.copy() for i in range(1 )]
												_lowerCAmelCase    		=					VGroup(*_lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					Text("""GPU"""       ,  font_size=24 )
												_lowerCAmelCase    		=					Group(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0.5       ,  aligned_edge=_lowercase )
												gpu.align_to(_lowercase       ,  _lowercase )
												gpu.set_x(gpu.get_x() - 1 )

												self.add(_lowercase )

												_lowerCAmelCase    		=					[mem.copy() for i in range(6 )]
												_lowerCAmelCase    		=					VGroup(*_lowercase ).arrange(_lowercase       ,  buff=0 )

												_lowerCAmelCase    		=					Text("""Model"""       ,  font_size=24 )
												_lowerCAmelCase    		=					Group(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0.5       ,  aligned_edge=_lowercase )
												model.move_to([3, -1.0, 0] )

												self.play(
												    Create(_lowercase       ,  run_time=1 )       ,  Create(_lowercase       ,  run_time=1 )       ,  Create(_lowercase       ,  run_time=1 )       ,  )

												_lowerCAmelCase    		=					MarkupText(
												    F'First, an empty model skeleton is loaded\ninto <span fgcolor=\'{YELLOW}\'>memory</span> without using much RAM.'       ,  font_size=24       ,  )

												_lowerCAmelCase    		=					Square(side_length=2.2 )
												key.move_to([-5, 2, 0] )

												_lowerCAmelCase    		=					MarkupText(
												    F'<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model'       ,  font_size=18       ,  )

												key_text.move_to([-5, 2.4, 0] )

												step_a.move_to([2, 2, 0] )
												self.play(Write(_lowercase       ,  run_time=2.5 )       ,  Write(_lowercase )       ,  Write(_lowercase ) )

												self.add(_lowercase )

												_lowerCAmelCase    		=					[]
												_lowerCAmelCase    		=					[]
												_lowerCAmelCase    		=					[]
												for i, rect in enumerate(_lowercase ):
																		_lowerCAmelCase    		=					Rectangle(height=0.46       ,  width=0.46 ).set_stroke(width=0.0 ).set_fill(_lowercase       ,  opacity=0.7 )
																		cpu_target.move_to(_lowercase )
																		cpu_target.generate_target()
																		_lowerCAmelCase    		=					0.46 / 4
																		_lowerCAmelCase    		=					0.46 / 3

																		if i == 0:
																								cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT )       ,  buff=0.02       ,  direction=_lowercase )
																								cpu_target.target.set_x(cpu_target.target.get_x() + 0.1 )
																		elif i == 3:
																								cpu_target.target.next_to(cpu_targs[0].target       ,  direction=_lowercase       ,  buff=0.0 )
																		else:
																								cpu_target.target.next_to(cpu_targs[i - 1].target       ,  direction=_lowercase       ,  buff=0.0 )
																		cpu_targs.append(_lowercase )

																		first_animations.append(rect.animate(run_time=0.5 ).set_stroke(_lowercase ) )
																		second_animations.append(MoveToTarget(_lowercase       ,  run_time=1.5 ) )

												self.play(*_lowercase )
												self.play(*_lowercase )

												self.wait()
