Update app.py
Browse files13 unmodified lines1415161718192036 unmodified lines5758596061626310 unmodified lines74757677787980818283848586878813 unmodified linesDESCRIPTION += "\n<p>Running on CPU 🥶 This demo may not work on CPU.</p>"MAX_SEED = np.iinfo(np.int32).maxCACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"36 unmodified linesif style=="BEST" :pipe.load_lora_weights("ehristoforu/dalle-3-xl-v2", weight_name="dalle-3-xl-lora-v2.safetensors", adapter_name="dalle2")pipe.load_lora_weights("ehristoforu/dalle-3-xl", weight_name="dalle-3-xl-lora-v1.safetensors", adapter_name="dalle1")pipe.set_adapters(["dalle2","dalle1"], adapter_weights=[1.5, 0.5])elif style=="Origami":pipe.load_lora_weights("RalFinger/origami-style-sdxl-lora", weight_name="ral-orgmi-sdxl.safetensors", adapter_name="origami")pipe.set_adapters(["origami"], adapter_weights=[2])10 unmodified linespipe.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="pixel")pipe.set_adapters(["lora", "pixel"], adapter_weights=[0.5, 1.2])else:pipe.load_lora_weights("artificialguybr/StickersRedmond", weight_name="StickersRedmond.safetensors", adapter_name="lora")pipe.set_adapters(["orignal"], adapter_weights=[0.1])pipe.to("cuda")seed = int(randomize_seed_fn(seed, randomize_seed))generator = torch.Generator().manual_seed(seed)options = {"prompt":prompt,"negative_prompt":negative_prompt,"width":width,"height":height,13 unmodified lines1415161718192036 unmodified lines5758596061626310 unmodified lines74757677787980818283848586878813 unmodified linesDESCRIPTION += "\n<p>Running on CPU 🥶 This demo may not work on CPU.</p>"MAX_SEED = np.iinfo(np.int32).maxCACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"36 unmodified linesif style=="BEST" :pipe.load_lora_weights("ehristoforu/dalle-3-xl-v2", weight_name="dalle-3-xl-lora-v2.safetensors", adapter_name="dalle2")pipe.load_lora_weights("ehristoforu/dalle-3-xl", weight_name="dalle-3-xl-lora-v1.safetensors", adapter_name="dalle1")pipe.set_adapters(["dalle2","dalle1"], adapter_weights=[0.7, 0.3])elif style=="Origami":pipe.load_lora_weights("RalFinger/origami-style-sdxl-lora", weight_name="ral-orgmi-sdxl.safetensors", adapter_name="origami")pipe.set_adapters(["origami"], adapter_weights=[2])10 unmodified linespipe.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="pixel")pipe.set_adapters(["lora", "pixel"], adapter_weights=[0.5, 1.2])else:pipe.load_lora_weights()pipe.to("cuda")seed = int(randomize_seed_fn(seed, randomize_seed))generator = torch.Generator().manual_seed(seed)options = {"prompt":prompt,"style":style,"negative_prompt":negative_prompt,"width":width,"height":height,
app.py+5-5