Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,8 @@ DESCRIPTION = """ # Instant Image
|
|
| 16 |
### <span style='color: red;'>You may change the steps from 4 to 8, if you didn't get satisfied results.
|
| 17 |
### First Image processing takes time then images generate faster.
|
| 18 |
"""
|
| 19 |
-
if not torch.cuda.is_available():
|
| 20 |
-
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
| 21 |
|
| 22 |
MAX_SEED = np.iinfo(np.int32).max
|
| 23 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"
|
|
@@ -78,7 +78,7 @@ pipe = PixArtAlphaPipeline.from_pretrained(
|
|
| 78 |
"PixArt-alpha/PixArt-LCM-XL-2-1024-MS",
|
| 79 |
torch_dtype=torch.float16,
|
| 80 |
use_safetensors=True,
|
| 81 |
-
).to(
|
| 82 |
|
| 83 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 84 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
|
|
|
| 16 |
### <span style='color: red;'>You may change the steps from 4 to 8, if you didn't get satisfied results.
|
| 17 |
### First Image processing takes time then images generate faster.
|
| 18 |
"""
|
| 19 |
+
#if not torch.cuda.is_available():
|
| 20 |
+
#DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
| 21 |
|
| 22 |
MAX_SEED = np.iinfo(np.int32).max
|
| 23 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"
|
|
|
|
| 78 |
"PixArt-alpha/PixArt-LCM-XL-2-1024-MS",
|
| 79 |
torch_dtype=torch.float16,
|
| 80 |
use_safetensors=True,
|
| 81 |
+
).to(device)
|
| 82 |
|
| 83 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 84 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|