Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 24 |
pipe = DiffusionPipeline.from_pretrained(
|
| 25 |
"black-forest-labs/FLUX.1-schnell",
|
| 26 |
torch_dtype=dtype,
|
| 27 |
-
device_map="
|
| 28 |
use_safetensors=True
|
| 29 |
).to(device)
|
| 30 |
|
|
@@ -70,6 +70,7 @@ def generate_diagram(prompt, seed=42, randomize_seed=False, width=1024, height=1
|
|
| 70 |
|
| 71 |
|
| 72 |
|
|
|
|
| 73 |
# Enhanced examples with more detailed prompts and specific styling
|
| 74 |
EXAMPLES = [
|
| 75 |
{
|
|
|
|
| 24 |
pipe = DiffusionPipeline.from_pretrained(
|
| 25 |
"black-forest-labs/FLUX.1-schnell",
|
| 26 |
torch_dtype=dtype,
|
| 27 |
+
device_map="balanced" if torch.cuda.is_available() else None,
|
| 28 |
use_safetensors=True
|
| 29 |
).to(device)
|
| 30 |
|
|
|
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
+
|
| 74 |
# Enhanced examples with more detailed prompts and specific styling
|
| 75 |
EXAMPLES = [
|
| 76 |
{
|