Spaces:
Sleeping
Sleeping
update app
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ prompt = f"A photo of {unique_id} {class_label} in a bucket"
|
|
27 |
# image = pipeline(prompt, num_inference_steps=50).images[0]
|
28 |
|
29 |
# generate images
|
30 |
-
def infer(prompt):
|
31 |
-
generated_images = pipeline(prompt, guidance_scale=
|
32 |
|
33 |
return generated_images.images
|
34 |
|
@@ -37,5 +37,13 @@ output = gr.Gallery(label="Outputs").style(grid=(1,2))
|
|
37 |
# customize interface
|
38 |
title = "KerasCV Stable Diffusion Demo on images of Ace."
|
39 |
description = "This is a dreambooth model fine-tuned on images of my pug named Ace. To try it, input the concept with `puggieace dog`."
|
40 |
-
examples=[
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
# image = pipeline(prompt, num_inference_steps=50).images[0]
|
28 |
|
29 |
# generate images
|
30 |
+
def infer(prompt, negative_prompt, guidance_scale=10, num_inference_steps=50):
|
31 |
+
generated_images = pipeline(prompt, guidance_scale=guidance_scale, num_inference_steps=num_inference_steps, num_images_per_prompt=2)
|
32 |
|
33 |
return generated_images.images
|
34 |
|
|
|
37 |
# customize interface
|
38 |
title = "KerasCV Stable Diffusion Demo on images of Ace."
|
39 |
description = "This is a dreambooth model fine-tuned on images of my pug named Ace. To try it, input the concept with `puggieace dog`."
|
40 |
+
examples=[
|
41 |
+
["A photo of puggieace dog in space", "", 50, 10],
|
42 |
+
["A photo of a cute puggieace dog getting a haircut in a barbershop, ultra realistic, intricate details, highly detailed, photorealistic, octane render, 8 k, unreal engine. art by artgerm and greg rutkowski and charlie bowater and magali villeneuve and alphonse mucha", "", 75, 12],
|
43 |
+
["Portrait painting of a cute puggieace dog with armor, ultra realistic, concept art, intricate details, eerie, highly detailed, photorealistic, octane render, 8 k, unreal engine. art by artgerm and greg rutkowski and charlie bowater", "", 75, 12],
|
44 |
+
]
|
45 |
+
gr.Interface(infer, inputs=[gr.Textbox(label="Positive Prompt", value="a photo of puggieace dog getting a haircut"),
|
46 |
+
gr.Textbox(label="Negative Prompt", value="bad anatomy, blurry"),
|
47 |
+
gr.Slider(label='Number of gen image', minimum=1, maximum=4, value=2, step=1),
|
48 |
+
gr.Slider(label="Inference Steps",value=50),
|
49 |
+
gr.Number(label='Guidance scale', value=12),], outputs=[output], title=title, description=description, examples=examples).queue().launch()
|