shellypeng/Anime-Pack
3
1# -*- coding: utf-8 -*-2"""Test_gradio_push.ipynb3 4Automatically generated by Colaboratory.5 6Original file is located at7 https://colab.research.google.com/drive/1mlZpAq-EWRmmLHH4Ok533awreqtJwzzW8"""9 10"""# HF Script11 12"""13 14# -*- coding: utf-8 -*-15"""Copy of Anime_Pack_Gradio.ipynb16 17Automatically generated by Colaboratory.18 19Original file is located at20 https://colab.research.google.com/drive/1RxVCwOkq3Q5qlEkQxhFGeUxICBujjEjR21"""22 23import os24 25from transformers import AutoTokenizer, AutoModelForSeq2SeqLM26 27tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-zh-en")28 29model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-zh-en")30 31import gradio as gr32import numpy as np33from PIL import Image34from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, DPMSolverMultistepScheduler, StableDiffusionImg2ImgPipeline35 36import torch37from controlnet_aux import HEDdetector38from diffusers.utils import load_image39 40import concurrent.futures41from threading import Thread42from compel import Compel43 44 45from transformers import pipeline46 47 48model_ckpt = "papluca/xlm-roberta-base-language-detection"49pipe = pipeline("text-classification", model=model_ckpt)50 51HF_TOKEN = os.environ.get("HUGGING_FACE_HUB_TOKEN")52 53device="cuda" if torch.cuda.is_available() else "cpu"54pipe_scribble, pipe_depth, pipe_img2img = None, None, None55 56hidden_booster_text = "masterpiece++, best quality++, ultra-detailed+ +, unity 8k wallpaper+, illustration+, anime style+, intricate, fluid simulation, sharp edges. glossy++, Smooth++, detailed eyes++, best quality++,4k++,8k++,highres++,masterpiece++,ultra- detailed,realistic++,photorealistic++,photo-realistic++,depth of field, ultra-high definition, highly detailed, natural lighting, sharp focus, cinematic, hyperrealism,extremely detailed"57hidden_negative = "bad anatomy, disfigured, poorly drawn,deformed, mutation, malformation, deformed, mutated, disfigured, deformed eyes+, bad face++, bad hands, poorly drawn hands, malformed hands, extra arms++, extra legs++, Fused body+, Fused hands+, Fused legs+, missing arms, missing limb, extra digit+, fewer digits, floating limbs, disconnected limbs, inaccurate limb, bad fingers, missing fingers, ugly face, long body++"58hidden_cn_booster_text = ",漂亮的脸"59hidden_cn_negative = ""60 61hed = HEDdetector.from_pretrained('lllyasviel/ControlNet')62 63controlnet_scribble = ControlNetModel.from_pretrained(64 "lllyasviel/sd-controlnet-scribble", torch_dtype=torch.float16, safety_checker=None, requires_safety_checker=False, )65depth_estimator = pipeline('depth-estimation')66 67controlnet_depth = ControlNetModel.from_pretrained(68 "lllyasviel/sd-controlnet-depth", torch_dtype=torch.float1669)70 71 72def translate(prompt):73 trans_text = prompt74 translated = model.generate(**tokenizer(trans_text, return_tensors="pt", padding=True))75 tgt_text = [tokenizer.decode(t, skip_special_tokens=True) for t in translated]76 tgt_text = ''.join(tgt_text)[:-1]77 return tgt_text78 79 80 81def load_pipe_scribble():82 global pipe_scribble83 if pipe_scribble is None:84 85 pipe_scribble = StableDiffusionControlNetPipeline.from_single_file(86 "https://huggingface.co/shellypeng/anime-god/blob/main/animeGod_v10.safetensors", controlnet=controlnet_scribble, safety_checker=None, requires_safety_checker=False,87 torch_dtype=torch.float16, token=HF_TOKEN88 )89 90 pipe_scribble.load_lora_weights("shellypeng/lora2")91 pipe_scribble.fuse_lora(lora_scale=0.1)92 93 pipe_scribble.load_textual_inversion("shellypeng/textinv1")94 pipe_scribble.load_textual_inversion("shellypeng/textinv2")95 pipe_scribble.load_textual_inversion("shellypeng/textinv3")96 pipe_scribble.load_textual_inversion("shellypeng/textinv4")97 pipe_scribble.scheduler = DPMSolverMultistepScheduler.from_config(pipe_scribble.scheduler.config, use_karras_sigmas=True)98 pipe_scribble.safety_checker = None99 pipe_scribble.requires_safety_checker = False100 pipe_scribble.to(device)101 pipe_scribble.safety_checker = lambda images, **kwargs: (images, [False] * len(images))102 103 104def load_pipe_depth():105 global pipe_depth106 if pipe_depth is None:107 108 109 pipe_depth = StableDiffusionControlNetPipeline.from_single_file(110 "https://huggingface.co/shellypeng/anime-god/blob/main/animeGod_v10.safetensors", controlnet=controlnet_depth,111 torch_dtype=torch.float16,112 )113 pipe_depth.load_lora_weights("shellypeng/lora1")114 pipe_depth.fuse_lora(lora_scale=0.3)115 116 pipe_depth.load_textual_inversion("shellypeng/textinv1")117 pipe_depth.load_textual_inversion("shellypeng/textinv2")118 pipe_depth.load_textual_inversion("shellypeng/textinv3")119 pipe_depth.load_textual_inversion("shellypeng/textinv4")120 pipe_depth.scheduler = DPMSolverMultistepScheduler.from_config(pipe_depth.scheduler.config, use_karras_sigmas=True)121 def dummy(images, **kwargs):122 return images, False123 pipe_depth.safety_checker = lambda images, **kwargs: (images, [False] * len(images))124 pipe_depth.to(device)125 126def load_pipe_img2img():127 global pipe_img2img128 if pipe_img2img is None:129 pipe_img2img = StableDiffusionImg2ImgPipeline.from_single_file("https://huggingface.co/shellypeng/anime-god/blob/main/animeGod_v10.safetensors",130 torch_dtype=torch.float16, safety_checker=None, requires_safety_checker=False, token=HF_TOKEN)131 132 pipe_img2img.load_lora_weights("shellypeng/lora1")133 pipe_img2img.fuse_lora(lora_scale=0.1)134 pipe_img2img.load_lora_weights("shellypeng/lora2", token=HF_TOKEN)135 pipe_img2img.fuse_lora(lora_scale=0.1)136 137 pipe_img2img.load_textual_inversion("shellypeng/textinv1")138 pipe_img2img.load_textual_inversion("shellypeng/textinv2")139 pipe_img2img.load_textual_inversion("shellypeng/textinv3")140 pipe_img2img.load_textual_inversion("shellypeng/textinv4")141 pipe_img2img.scheduler = DPMSolverMultistepScheduler.from_config(pipe_img2img.scheduler.config, use_karras_sigmas=True)142 pipe_img2img.safety_checker = None143 pipe_img2img.requires_safety_checker = False144 pipe_img2img.to(device)145 146 pipe_img2img.safety_checker = lambda images, **kwargs: (images, [False] * len(images))147 148 149def real_to_anime(text, input_img):150 """151 pass the sd model and do scribble to image152 include Adetailer, detail tweaker lora, prompt backend include: beautiful eyes, beautiful face, beautiful hand, (maybe infer from user's prompt for gesture and facial153 expression to improve hand)154 """155 load_pipe_depth()156 input_img = Image.fromarray(input_img)157 input_img = load_image(input_img)158 input_img = depth_estimator(input_img)['depth']159 res_image0 = pipe_depth(text, input_img, negative_prompt=hidden_negative, num_inference_steps=40).images[0]160 res_image1 = pipe_depth(text, input_img, negative_prompt=hidden_negative, num_inference_steps=40).images[0]161 res_image2 = pipe_depth(text, input_img, negative_prompt=hidden_negative, num_inference_steps=40).images[0]162 res_image3 = pipe_depth(text, input_img, negative_prompt=hidden_negative, num_inference_steps=40).images[0]163 164 return res_image0, res_image1, res_image2, res_image3165 166 167 168 169def scribble_to_image(text, neg_prompt_box, input_img):170 """171 pass the sd model and do scribble to image172 include Adetailer, detail tweaker lora, prompt backend include: beautiful eyes, beautiful face, beautiful hand, (maybe infer from user's prompt for gesture and facial173 expression to improve hand)174 """175 load_pipe_scribble()176 177 178# if auto detect detects chinese => auto turn on chinese prompting checkbox179 # change param "bag" below to text, image param below to input_img180 input_img = Image.fromarray(input_img)181 input_img = hed(input_img, scribble=True)182 input_img = load_image(input_img)183 # global prompt184 lang_check_label = pipe(text, top_k=1, truncation=True)[0]['label']185 lang_check_score = pipe(text, top_k=1, truncation=True)[0]['score']186 if lang_check_label == 'zh' and lang_check_score >= 0.85:187 text = translate(text)188 compel_proc = Compel(tokenizer=pipe_scribble.tokenizer, text_encoder=pipe_scribble.text_encoder)189 prompt = text + hidden_booster_text190 prompt_embeds = compel_proc(prompt)191 negative_prompt = neg_prompt_box + hidden_negative192 negative_prompt_embeds = compel_proc(negative_prompt)193 194 res_image0 = pipe_scribble(image=input_img, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]195 res_image1 = pipe_scribble(image=input_img, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]196 res_image2 = pipe_scribble(image=input_img, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]197 res_image3 = pipe_scribble(image=input_img, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]198 199 return res_image0, res_image1, res_image2, res_image3200 201def real_img2img_to_anime(text, neg_prompt_box, input_img):202 """203 pass the sd model and do scribble to image204 include Adetailer, detail tweaker lora, prompt backend include: beautiful eyes, beautiful face, beautiful hand, (maybe infer from user's prompt for gesture and facial205 expression to improve hand)206 """207 load_pipe_img2img()208 input_img = Image.fromarray(input_img)209 input_img = load_image(input_img)210 lang_check_label = pipe(text, top_k=1, truncation=True)[0]['label']211 lang_check_score = pipe(text, top_k=1, truncation=True)[0]['score']212 if lang_check_label == 'zh' and lang_check_score >= 0.85:213 text = translate(text)214 215 compel_proc = Compel(tokenizer=pipe_img2img.tokenizer, text_encoder=pipe_img2img.text_encoder)216 prompt = text + hidden_booster_text217 prompt_embeds = compel_proc(prompt)218 219 negative_prompt = neg_prompt_box + hidden_negative220 negative_prompt_embeds = compel_proc(negative_prompt)221 # input_img = depth_estimator(input_img)['depth']222 res_image0 = pipe_img2img(image=input_img, strength=0.8, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]223 res_image1 = pipe_img2img(image=input_img, strength=0.8, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]224 res_image2 = pipe_img2img(image=input_img, strength=0.8, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]225 res_image3 = pipe_img2img(image=input_img, strength=0.8, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, num_inference_steps=40).images[0]226 227 return res_image0, res_image1, res_image2, res_image3228 229 230 231 232theme = gr.themes.Soft(233 primary_hue="orange",234 secondary_hue="orange",235).set(236 block_background_fill='*primary_50'237)238 239 240 241def zh_prompt_info(text, neg_text, chinese_check):242 can_raise_info = ""243 lang_check_label = pipe(text, top_k=1, truncation=True)[0]['label']244 lang_check_score = pipe(text, top_k=1, truncation=True)[0]['score']245 neg_lang_check_label = pipe(neg_text, top_k=1, truncation=True)[0]['label']246 neg_lang_check_score = pipe(neg_text, top_k=1, truncation=True)[0]['score']247 print(lang_check_label)248 if lang_check_label == 'zh' and lang_check_score >= 0.85:249 if not chinese_check:250 chinese_check = True251 can_raise_info = "zh"252 if neg_lang_check_label == 'en' and neg_lang_check_score >= 0.85:253 can_raise_info = "invalid"254 return True, can_raise_info255 elif lang_check_label == 'en' and lang_check_score >= 0.85:256 if chinese_check:257 chinese_check = False258 can_raise_info = "en"259 if neg_lang_check_label == 'zh' and neg_lang_check_score >= 0.85:260 can_raise_info = "invalid"261 return False, can_raise_info262 return chinese_check, can_raise_info263def mult_thread_img2img(prompt_box, neg_prompt_box, image_box):264 with concurrent.futures.ThreadPoolExecutor(max_workers=12000) as executor:265 future = executor.submit(real_img2img_to_anime, prompt_box, neg_prompt_box, image_box)266 image1, image2, image3, image4 = future.result()267 return image1, image2, image3, image4268def mult_thread_scribble(prompt_box, neg_prompt_box, image_box):269 with concurrent.futures.ThreadPoolExecutor(max_workers=12000) as executor:270 future = executor.submit(scribble_to_image, prompt_box, neg_prompt_box, image_box)271 image1, image2, image3, image4 = future.result()272 return image1, image2, image3, image4273def mult_thread_live_scribble(prompt_box, neg_prompt_box, image_box):274 image_box = image_box["composite"]275 with concurrent.futures.ThreadPoolExecutor(max_workers=12000) as executor:276 future = executor.submit(scribble_to_image, prompt_box, neg_prompt_box, image_box)277 image1, image2, image3, image4 = future.result()278 return image1, image2, image3, image4279def mult_thread_lang_class(prompt_box, neg_prompt_box, chinese_check):280 281 with concurrent.futures.ThreadPoolExecutor(max_workers=12000) as executor:282 future = executor.submit(zh_prompt_info, prompt_box, neg_prompt_box, chinese_check)283 chinese_check, can_raise_info = future.result()284 if can_raise_info == "zh":285 gr.Info("Chinese Language Detected, Switching to Chinese Prompt Mode")286 elif can_raise_info == "en":287 gr.Info("English Language Detected, Disabling Chinese Prompt Mode")288 return chinese_check289 290 291with gr.Blocks(theme=theme, css="footer {visibility: hidden}", title="ShellAI Apps") as iface:292 with gr.Tab("AnimeDepth(安妮深度)"):293 gr.Markdown(294 """295 # AnimeDepth(安妮深度)296 Turns pictures into one in the anime style with depth-to-image controlnet.297 将图片用深度图的方式转为动漫风图片。298 """299 )300 with gr.Row(equal_height=True):301 with gr.Column():302 with gr.Row(equal_height=True):303 with gr.Column(scale=4):304 prompt_box = gr.Textbox(label="Prompt(提示词)", placeholder="Enter a prompt\n输入提示词", lines=3)305 neg_prompt_box = gr.Textbox(label="Negative Prompt(负面提示词)", placeholder="Enter a negative prompt(things you don't want to include in the generated image)\n输入负面提示词:输入您不想生成的部分", lines=3)306 with gr.Row(equal_height=True):307 chinese_check = gr.Checkbox(label="Chinese Prompt Mode(中文提示词模式)", info="Click here to enable Chinese Prompting(点此触发中文提示词输入)")308 309 image_box = gr.Image(label="Input Image(上传图片)", height=400)310 gen_btn = gr.Button(value="Generate(生成)")311 312 with gr.Row(equal_height=True):313 image1 = gr.Image(label="Result 1(结果图 1)")314 image2 = gr.Image(label="Result 2(结果图 2)")315 image3 = gr.Image(label="Result 3(结果图 3)")316 image4 = gr.Image(label="Result 4(结果图 4)")317 example_img2img = [318 ["漂亮的女孩,微笑,长发,黑发,粉色外套,白色内衬,优雅,红色背景,红色窗帘", "低画质", "sunmi.jpg"],319 ["Beautiful girl, smiling, bun, bun hair, black hair, beautiful eyes, black dress, elegant, red carpet photo","ugly, bad quality", "emma.jpg"]320 ]321 322 # gr.Examples(examples=example_img2img, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4], fn=mult_thread_img2img, cache_examples=True)323 324 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_lang_class, inputs=[prompt_box, neg_prompt_box, chinese_check], outputs=[chinese_check], show_progress=False)325 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=real_to_anime, inputs=[prompt_box, image_box], outputs=[image1, image2, image3, image4])326 327 with gr.Tab("Animefier(安妮漫风)"):328 gr.Markdown(329 """330 # Animefier(安妮漫风)331 Turns realistic photos into one in the anime style.332 将真实图片转为动漫风图片。333 """334 )335 with gr.Row(equal_height=True):336 with gr.Column():337 with gr.Row(equal_height=True):338 with gr.Column(scale=4):339 prompt_box = gr.Textbox(label="Prompt(提示词)", placeholder="Enter a prompt\n输入提示词", lines=3)340 neg_prompt_box = gr.Textbox(label="Negative Prompt(负面提示词)", placeholder="Enter a negative prompt(things you don't want to include in the generated image)\n输入负面提示词:输入您不想生成的部分", lines=3)341 with gr.Row(equal_height=True):342 chinese_check = gr.Checkbox(label="Chinese Prompt Mode(中文提示词模式)", info="Click here to enable Chinese Prompting(点此触发中文提示词输入)")343 344 image_box = gr.Image(label="Input Image(上传图片)", height=400)345 gen_btn = gr.Button(value="Generate(生成)")346 347 with gr.Row(equal_height=True):348 image1 = gr.Image(label="Result 1(结果图 1)")349 image2 = gr.Image(label="Result 2(结果图 2)")350 image3 = gr.Image(label="Result 3(结果图 3)")351 image4 = gr.Image(label="Result 4(结果图 4)")352 example_img2img = [353 ["漂亮的女孩,微笑,长发,黑发,粉色外套,白色内衬,优雅,红色背景,红色窗帘", "低画质", "sunmi.jpg"],354 ["Beautiful girl, smiling, bun, bun hair, black hair, beautiful eyes, black dress, elegant, red carpet photo","ugly, bad quality", "emma.jpg"]355 ]356 357 # gr.Examples(examples=example_img2img, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4], fn=mult_thread_img2img, cache_examples=True)358 359 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_lang_class, inputs=[prompt_box, neg_prompt_box, chinese_check], outputs=[chinese_check], show_progress=False)360 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_img2img, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4])361 with gr.Tab("Live Sketch(实时涂鸦)"):362 gr.Markdown(363 """364 # Live Sketch(实时涂鸦)365 Live draw sketches/scribbles and turns into one in the anime style.366 实时涂鸦,将粗线条涂鸦转为动漫风图片。367 """368 )369 with gr.Row(equal_height=True):370 with gr.Column():371 with gr.Row(equal_height=True):372 with gr.Column(scale=4):373 prompt_box = gr.Textbox(label="Prompt(提示词)", placeholder="Enter a prompt\n输入提示词", lines=3)374 neg_prompt_box = gr.Textbox(label="Negative Prompt(负面提示词)", placeholder="Enter a negative prompt(things you don't want to include in the generated image)\n输入负面提示词:输入您不想生成的部分", lines=3)375 with gr.Row(equal_height=True):376 chinese_check = gr.Checkbox(label="Chinese Prompt Mode(中文提示词模式)", info="Click here to enable Chinese Prompting(点此触发中文提示词输入)")377 image_box = gr.ImageEditor(sources=(), brush=gr.Brush(default_size="5", color_mode="fixed", colors=["#000000"]), height=400)378 379 gen_btn = gr.Button(value="Generate(生成)")380 with gr.Row(equal_height=True):381 image1 = gr.Image(label="Result 1(结果图 1)")382 image2 = gr.Image(label="Result 2(结果图 2)")383 image3 = gr.Image(label="Result 3(结果图 3)")384 image4 = gr.Image(label="Result 4(结果图 4)")385 # sketch_image_box.change(fn=mult_thread_scribble, inputs=[prompt_box, neg_prompt_box, sketch_image_box], outputs=[image1, image2, image3, image4])386 example_scribble_live2img = [387 ["帅气的男孩,橙色头发++,皱眉,闭眼,深蓝色开襟毛衣,白色内衬,酷,冷漠,帅气,硝烟背景", "劣质", "sketch_boy.png"],388 ["a beautiful girl spreading her arms, blue hair, long hair, hat with flowers on its edge, smiling++, dynamic, black dress, park background, birds, trees, flowers, grass","ugly, worst quality", "girl_spread.jpg"]389 ]390 391 # gr.Examples(examples=example_scribble_live2img, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4], fn=mult_thread_live_scribble, cache_examples=True)392 393 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_lang_class, inputs=[prompt_box, neg_prompt_box, chinese_check], outputs=[chinese_check], show_progress=False)394 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_live_scribble, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4])395 396 with gr.Tab("AniSketch(安妮涂鸦)"):397 gr.Markdown(398 """399 # AniSketch(安妮涂鸦)400 Turns sketches/scribbles into one in the anime style.401 将草图、粗线条涂鸦转为动漫风图片。402 """403 )404 with gr.Row(equal_height=True):405 with gr.Column():406 with gr.Row(equal_height=True):407 with gr.Column(scale=4):408 prompt_box = gr.Textbox(label="Prompt(提示词)", placeholder="Enter a prompt\n输入提示词", lines=3)409 neg_prompt_box = gr.Textbox(label="Negative Prompt(负面提示词)", placeholder="Enter a negative prompt(things you don't want to include in the generated image)\n输入负面提示词:输入您不想生成的部分", lines=3)410 with gr.Row(equal_height=True):411 chinese_check = gr.Checkbox(label="Chinese Prompt Mode(中文提示词模式)", info="Click here to enable Chinese Prompting(点此触发中文提示词输入)")412 image_box = gr.Image(label="Input Image(上传图片)", height=400)413 414 gen_btn = gr.Button(value="Generate(生成)")415 with gr.Row(equal_height=True):416 image1 = gr.Image(label="Result 1(结果图 1)")417 image2 = gr.Image(label="Result 2(结果图 2)")418 image3 = gr.Image(label="Result 3(结果图 3)")419 image4 = gr.Image(label="Result 4(结果图 4)")420 example_scribble2img = [421 ["漂亮的女人,散开的长发,巫师,巫师袍,微笑,拍手,优雅,成熟,月夜背景", "水印", "final_witch.jpg"],422 ["a man wearing a chinese clothes, closed eyes, handsome face, dragon on the clothes, expressionless face, indifferent, chinese building background","poor quality", "chinese_man.jpg"]423 ]424 425 # gr.Examples(examples=example_scribble2img, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4], fn=mult_thread_scribble, cache_examples=True)426 427 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_lang_class, inputs=[prompt_box, neg_prompt_box, chinese_check], outputs=[chinese_check], show_progress=False)428 gr.on(triggers=[prompt_box.submit, gen_btn.click],fn=mult_thread_scribble, inputs=[prompt_box, neg_prompt_box, image_box], outputs=[image1, image2, image3, image4])429 430 431def run():432 iface.queue(default_concurrency_limit=20).launch(debug=True, share=True)433 434run()435 436"""# Separator437 438"""439 440 441 