Spaces:
Running
Running
Update app.py
Browse filesAdded Negative Prompt
app.py
CHANGED
@@ -12,9 +12,9 @@ scheduler = EulerDiscreteScheduler.from_pretrained("stabilityai/stable-diffusion
|
|
12 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2", scheduler=scheduler)
|
13 |
pipe = pipe.to(device)
|
14 |
|
15 |
-
def genie (prompt, scale, steps, seed):
|
16 |
generator = torch.Generator(device=device).manual_seed(seed)
|
17 |
-
images = pipe(prompt, width=768, height=768, num_inference_steps=steps, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images[0]
|
18 |
return images
|
19 |
|
20 |
-
gr.Interface(fn=genie, inputs=['
|
|
|
12 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2", scheduler=scheduler)
|
13 |
pipe = pipe.to(device)
|
14 |
|
15 |
+
def genie (prompt, negative_prompt, scale, steps, seed):
|
16 |
generator = torch.Generator(device=device).manual_seed(seed)
|
17 |
+
images = pipe(prompt, negative_prompt=negative_prompt, width=768, height=768, num_inference_steps=steps, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images[0]
|
18 |
return images
|
19 |
|
20 |
+
gr.Interface(fn=genie, inputs=[gr.Textbox('What you want the AI to generate. 77 Token Limit.'), gr.Textbox(label='What you Do Not want the AI to generate.').Slider(1, 25, 10), gr.Slider(1, maximum=20, value=10, step=1), gr.Slider(minimum=1, step=1, maximum=999999999999999999, randomize=True)], outputs='image', title="Stable Diffusion 2.0 CPU", description="SD 2.0 CPU. <b>WARNING:</b> Extremely Slow. 130s/Iteration. Expect 25-50mins an image for 10-20 iterations respectively.", article = "Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch()
|