Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -14,12 +14,13 @@ pipe.enable_xformers_memory_efficient_attention()
|
|
14 |
torch.cuda.empty_cache()
|
15 |
|
16 |
def genie (Prompt, negative_prompt, height, width, scale, steps, seed):
|
|
|
|
|
|
|
17 |
torch.cuda.empty_cache()
|
18 |
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16").to(device)
|
19 |
refiner.enable_xformers_memory_efficient_attention()
|
20 |
torch.cuda.empty_cache()
|
21 |
-
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
22 |
-
int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
23 |
image = refiner(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=.99).images[0]
|
24 |
torch.cuda.empty_cache()
|
25 |
|
|
|
14 |
torch.cuda.empty_cache()
|
15 |
|
16 |
def genie (Prompt, negative_prompt, height, width, scale, steps, seed):
|
17 |
+
torch.cuda.empty_cache()
|
18 |
+
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
19 |
+
int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
20 |
torch.cuda.empty_cache()
|
21 |
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16").to(device)
|
22 |
refiner.enable_xformers_memory_efficient_attention()
|
23 |
torch.cuda.empty_cache()
|
|
|
|
|
24 |
image = refiner(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=.99).images[0]
|
25 |
torch.cuda.empty_cache()
|
26 |
|