Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,10 @@ import random
|
|
| 12 |
from diffusers import StableDiffusionXLPipeline
|
| 13 |
from gradio_imageslider import ImageSlider
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 16 |
"stabilityai/stable-diffusion-xl-base-1.0",
|
| 17 |
custom_pipeline="multimodalart/sdxl_perturbed_attention_guidance",
|
|
@@ -22,7 +26,7 @@ device="cuda"
|
|
| 22 |
pipe = pipe.to(device)
|
| 23 |
|
| 24 |
@spaces.GPU
|
| 25 |
-
def run(prompt, negative_prompt="", guidance_scale=7.0, pag_scale=3.0, randomize_seed, seed, progress=gr.Progress(track_tqdm=True)):
|
| 26 |
if(randomize_seed):
|
| 27 |
seed = random.randint(0, sys.maxsize)
|
| 28 |
if(prompt == ""):
|
|
@@ -42,7 +46,7 @@ margin: 0 auto;
|
|
| 42 |
}
|
| 43 |
'''
|
| 44 |
|
| 45 |
-
with gr.Blocks(css=css) as demo:
|
| 46 |
gr.Markdown('''# Perturbed Attention Guidance SDXL
|
| 47 |
SDXL 🧨 [diffusers implementation](https://huggingface.co/multimodalart/sdxl_perturbed_attention_guidance) of [Perturbed-Attenton Guidance](https://ku-cvlab.github.io/Perturbed-Attention-Guidance/)
|
| 48 |
''')
|
|
|
|
| 12 |
from diffusers import StableDiffusionXLPipeline
|
| 13 |
from gradio_imageslider import ImageSlider
|
| 14 |
|
| 15 |
+
theme = gr.themes.Base(
|
| 16 |
+
font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 20 |
"stabilityai/stable-diffusion-xl-base-1.0",
|
| 21 |
custom_pipeline="multimodalart/sdxl_perturbed_attention_guidance",
|
|
|
|
| 26 |
pipe = pipe.to(device)
|
| 27 |
|
| 28 |
@spaces.GPU
|
| 29 |
+
def run(prompt, negative_prompt="", guidance_scale=7.0, pag_scale=3.0, randomize_seed=True, seed=42, progress=gr.Progress(track_tqdm=True)):
|
| 30 |
if(randomize_seed):
|
| 31 |
seed = random.randint(0, sys.maxsize)
|
| 32 |
if(prompt == ""):
|
|
|
|
| 46 |
}
|
| 47 |
'''
|
| 48 |
|
| 49 |
+
with gr.Blocks(css=css, theme=theme) as demo:
|
| 50 |
gr.Markdown('''# Perturbed Attention Guidance SDXL
|
| 51 |
SDXL 🧨 [diffusers implementation](https://huggingface.co/multimodalart/sdxl_perturbed_attention_guidance) of [Perturbed-Attenton Guidance](https://ku-cvlab.github.io/Perturbed-Attention-Guidance/)
|
| 52 |
''')
|