Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,12 +11,13 @@ from pathos.multiprocessing import ProcessingPool as ProcessPoolExecutor
|
|
| 11 |
import requests
|
| 12 |
from lxml.html import fromstring
|
| 13 |
|
| 14 |
-
pool = ProcessPoolExecutor(
|
| 15 |
pool.__enter__()
|
| 16 |
|
|
|
|
| 17 |
model_id = "stabilityai/stable-diffusion-3-medium-diffusers"
|
| 18 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 19 |
|
|
|
|
| 20 |
if torch.cuda.is_available():
|
| 21 |
torch.cuda.max_memory_allocated(device=device)
|
| 22 |
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
|
@@ -72,7 +73,7 @@ def infer(prompt):
|
|
| 72 |
css="""
|
| 73 |
#col-container {
|
| 74 |
margin: 0 auto;
|
| 75 |
-
max-width:
|
| 76 |
}
|
| 77 |
#image-container {
|
| 78 |
aspect-ratio: 1 / 1;
|
|
|
|
| 11 |
import requests
|
| 12 |
from lxml.html import fromstring
|
| 13 |
|
| 14 |
+
pool = ProcessPoolExecutor(8)
|
| 15 |
pool.__enter__()
|
| 16 |
|
| 17 |
+
#model_id = "runwayml/stable-diffusion-v1-5"
|
| 18 |
model_id = "stabilityai/stable-diffusion-3-medium-diffusers"
|
|
|
|
| 19 |
|
| 20 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
if torch.cuda.is_available():
|
| 22 |
torch.cuda.max_memory_allocated(device=device)
|
| 23 |
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
|
|
|
| 73 |
css="""
|
| 74 |
#col-container {
|
| 75 |
margin: 0 auto;
|
| 76 |
+
max-width: 16cm;
|
| 77 |
}
|
| 78 |
#image-container {
|
| 79 |
aspect-ratio: 1 / 1;
|