Update app.py
Browse filesUpgraded to SDXL 1.0
app.py
CHANGED
@@ -15,7 +15,7 @@ torch.cuda.empty_cache()
|
|
15 |
|
16 |
def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaler):
|
17 |
torch.cuda.max_memory_allocated(device='cuda')
|
18 |
-
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-0
|
19 |
pipe = pipe.to(device)
|
20 |
pipe.enable_xformers_memory_efficient_attention()
|
21 |
torch.cuda.empty_cache()
|
@@ -24,7 +24,7 @@ def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaler)
|
|
24 |
torch.cuda.empty_cache()
|
25 |
if upscaler == 'Yes':
|
26 |
torch.cuda.max_memory_allocated(device='cuda')
|
27 |
-
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-0
|
28 |
pipe = pipe.to(device)
|
29 |
pipe.enable_xformers_memory_efficient_attention()
|
30 |
image = pipe(prompt=prompt, image=int_image).images[0]
|
|
|
15 |
|
16 |
def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaler):
|
17 |
torch.cuda.max_memory_allocated(device='cuda')
|
18 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
19 |
pipe = pipe.to(device)
|
20 |
pipe.enable_xformers_memory_efficient_attention()
|
21 |
torch.cuda.empty_cache()
|
|
|
24 |
torch.cuda.empty_cache()
|
25 |
if upscaler == 'Yes':
|
26 |
torch.cuda.max_memory_allocated(device='cuda')
|
27 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
28 |
pipe = pipe.to(device)
|
29 |
pipe.enable_xformers_memory_efficient_attention()
|
30 |
image = pipe(prompt=prompt, image=int_image).images[0]
|