Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ if not torch.cuda.is_available():
|
|
14 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo may not work on CPU.</p>"
|
15 |
|
16 |
MAX_SEED = np.iinfo(np.int32).max
|
17 |
-
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "
|
18 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
19 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
20 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
@@ -39,7 +39,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
39 |
seed = random.randint(0, MAX_SEED)
|
40 |
return seed
|
41 |
|
42 |
-
@spaces.GPU(duration=
|
43 |
def generate(
|
44 |
prompt: str,
|
45 |
style: str = "BEST",
|
@@ -74,7 +74,7 @@ def generate(
|
|
74 |
pipe.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="pixel")
|
75 |
pipe.set_adapters(["lora", "pixel"], adapter_weights=[0.5, 1.2])
|
76 |
else:
|
77 |
-
pipe.load_lora_weights("
|
78 |
pipe.set_adapters(["orignal"], adapter_weights=[0.1])
|
79 |
|
80 |
pipe.to("cuda")
|
|
|
14 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo may not work on CPU.</p>"
|
15 |
|
16 |
MAX_SEED = np.iinfo(np.int32).max
|
17 |
+
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"
|
18 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
19 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
20 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
|
|
39 |
seed = random.randint(0, MAX_SEED)
|
40 |
return seed
|
41 |
|
42 |
+
@spaces.GPU(duration=60, queue=False)
|
43 |
def generate(
|
44 |
prompt: str,
|
45 |
style: str = "BEST",
|
|
|
74 |
pipe.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="pixel")
|
75 |
pipe.set_adapters(["lora", "pixel"], adapter_weights=[0.5, 1.2])
|
76 |
else:
|
77 |
+
pipe.load_lora_weights("artificialguybr/StickersRedmond", weight_name="StickersRedmond.safetensors", adapter_name="lora")
|
78 |
pipe.set_adapters(["orignal"], adapter_weights=[0.1])
|
79 |
|
80 |
pipe.to("cuda")
|