Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import json
|
|
| 9 |
import os
|
| 10 |
|
| 11 |
from diffusers import StableDiffusionXLPipeline, StableDiffusion3Pipeline
|
|
|
|
| 12 |
from PIL import Image
|
| 13 |
|
| 14 |
# Pre-Initialize
|
|
@@ -29,6 +30,8 @@ DEFAULT_WIDTH = 1024
|
|
| 29 |
|
| 30 |
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {HF_TOKEN}" }
|
| 31 |
|
|
|
|
|
|
|
| 32 |
css = '''
|
| 33 |
.gradio-container{max-width: 560px !important}
|
| 34 |
h1{text-align:center}
|
|
@@ -51,7 +54,7 @@ repo_customs = {
|
|
| 51 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 52 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 53 |
"Pixel": repo_pixel,
|
| 54 |
-
"Large": StableDiffusion3Pipeline.from_pretrained(
|
| 55 |
}
|
| 56 |
|
| 57 |
# Functions
|
|
|
|
| 9 |
import os
|
| 10 |
|
| 11 |
from diffusers import StableDiffusionXLPipeline, StableDiffusion3Pipeline
|
| 12 |
+
from huggingface_hub import snapshot_download
|
| 13 |
from PIL import Image
|
| 14 |
|
| 15 |
# Pre-Initialize
|
|
|
|
| 30 |
|
| 31 |
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {HF_TOKEN}" }
|
| 32 |
|
| 33 |
+
repo_large_path = snapshot_download(repo_id="stabilityai/stable-diffusion-3-medium", revision="refs/pr/26", repo_type="model", ignore_patterns=["*.md", "*..gitattributes"], local_dir="stable-diffusion-3-medium", token=HF_TOKEN)
|
| 34 |
+
|
| 35 |
css = '''
|
| 36 |
.gradio-container{max-width: 560px !important}
|
| 37 |
h1{text-align:center}
|
|
|
|
| 54 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 55 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 56 |
"Pixel": repo_pixel,
|
| 57 |
+
"Large": StableDiffusion3Pipeline.from_pretrained(repo_large_path, torch_dtype=torch.float16, use_safetensors=True),
|
| 58 |
}
|
| 59 |
|
| 60 |
# Functions
|