Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,15 +21,15 @@ else:
|
|
21 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo", use_safetensors=True)
|
22 |
pipe = pipe.to(device)
|
23 |
#pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
24 |
-
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True)
|
25 |
-
refiner = refiner.to(device)
|
26 |
#refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
27 |
|
28 |
def genie (prompt, negative_prompt, height, width, scale, steps, seed, prompt_2, negative_prompt_2, high_noise_frac):
|
29 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
30 |
-
int_image = pipe(prompt, prompt_2=prompt_2, height=height, width=width, num_inference_steps=steps, num_images_per_prompt=1, generator=generator
|
31 |
-
image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, denoising_start=high_noise_frac).images[0]
|
32 |
-
return
|
33 |
|
34 |
gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
|
35 |
gr.Textbox(label='What you Do Not want the AI to generate.'),
|
|
|
21 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo", use_safetensors=True)
|
22 |
pipe = pipe.to(device)
|
23 |
#pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
24 |
+
#refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True)
|
25 |
+
#refiner = refiner.to(device)
|
26 |
#refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
27 |
|
28 |
def genie (prompt, negative_prompt, height, width, scale, steps, seed, prompt_2, negative_prompt_2, high_noise_frac):
|
29 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
30 |
+
int_image = pipe(prompt, prompt_2=prompt_2, height=height, width=width, num_inference_steps=steps, num_images_per_prompt=1, generator=generator).images[0]
|
31 |
+
#image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, denoising_start=high_noise_frac).images[0]
|
32 |
+
return int_image
|
33 |
|
34 |
gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
|
35 |
gr.Textbox(label='What you Do Not want the AI to generate.'),
|