Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,35 +43,25 @@ def run(image, src_style, src_prompt, prompts, shared_score_shift, shared_score_
|
|
| 43 |
images_pil = [Image.fromarray((img * 255).astype(np.uint8)) for img in images_a]
|
| 44 |
return images_pil
|
| 45 |
|
|
|
|
| 46 |
with gr.Blocks() as demo:
|
| 47 |
gr.Markdown('''# Welcome to Tonic's Stable Style Align
|
| 48 |
Here you can generate images with a style from a reference image using [transfer style from sdxl](https://huggingface.co/docs/diffusers/main/en/using-diffusers/sdxl). Add a reference picture, describe the style and add prompts to generate images in that style. It's the most interesting with your own art!''')
|
| 49 |
|
| 50 |
-
image_input = gr.Image(label="Reference image", type="pil")
|
| 51 |
-
style_input = gr.Textbox(label="Describe the reference style")
|
| 52 |
-
image_desc_input = gr.Textbox(label="Describe the reference image")
|
| 53 |
-
prompts_input = gr.Textbox(label="Prompts to generate images (separate with new lines)", lines=5)
|
| 54 |
-
shared_score_shift_input = gr.Slider(value=1.1, label="shared_score_shift", minimum=1.0, maximum=2.0, step=0.05)
|
| 55 |
-
shared_score_scale_input = gr.Slider(value=1.0, label="shared_score_scale", minimum=0.0, maximum=1.0, step=0.05)
|
| 56 |
-
guidance_scale_input = gr.Slider(value=10.0, label="guidance_scale", minimum=5.0, maximum=20.0, step=1)
|
| 57 |
-
num_inference_steps_input = gr.Slider(value=12, label="num_inference_steps", minimum=1, maximum=12, step=1)
|
| 58 |
-
large_input = gr.Checkbox(False, label="Large (1024x1024)")
|
| 59 |
-
seed_input = gr.Slider(value=0, label="seed (0 for random)", minimum=0, maximum=1000000, step=42)
|
| 60 |
-
|
| 61 |
with gr.Row():
|
| 62 |
-
image_input.
|
| 63 |
with gr.Row():
|
| 64 |
-
style_input.
|
| 65 |
-
image_desc_input.
|
| 66 |
-
prompts_input.
|
| 67 |
with gr.Accordion(label="Advanced Settings"):
|
| 68 |
with gr.Row():
|
| 69 |
-
shared_score_shift_input.
|
| 70 |
-
shared_score_scale_input.
|
| 71 |
-
guidance_scale_input.
|
| 72 |
-
num_inference_steps_input.
|
| 73 |
-
large_input.
|
| 74 |
-
seed_input.
|
| 75 |
with gr.Row():
|
| 76 |
run_button = gr.Button("Generate Images")
|
| 77 |
with gr.Row():
|
|
|
|
| 43 |
images_pil = [Image.fromarray((img * 255).astype(np.uint8)) for img in images_a]
|
| 44 |
return images_pil
|
| 45 |
|
| 46 |
+
|
| 47 |
with gr.Blocks() as demo:
|
| 48 |
gr.Markdown('''# Welcome to Tonic's Stable Style Align
|
| 49 |
Here you can generate images with a style from a reference image using [transfer style from sdxl](https://huggingface.co/docs/diffusers/main/en/using-diffusers/sdxl). Add a reference picture, describe the style and add prompts to generate images in that style. It's the most interesting with your own art!''')
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
with gr.Row():
|
| 52 |
+
image_input = gr.Image(label="Reference image", type="pil")
|
| 53 |
with gr.Row():
|
| 54 |
+
style_input = gr.Textbox(label="Describe the reference style")
|
| 55 |
+
image_desc_input = gr.Textbox(label="Describe the reference image")
|
| 56 |
+
prompts_input = gr.Textbox(label="Prompts to generate images (separate with new lines)", lines=5)
|
| 57 |
with gr.Accordion(label="Advanced Settings"):
|
| 58 |
with gr.Row():
|
| 59 |
+
shared_score_shift_input = gr.Slider(value=1.1, label="shared_score_shift", minimum=1.0, maximum=2.0, step=0.05)
|
| 60 |
+
shared_score_scale_input = gr.Slider(value=1.0, label="shared_score_scale", minimum=0.0, maximum=1.0, step=0.05)
|
| 61 |
+
guidance_scale_input = gr.Slider(value=10.0, label="guidance_scale", minimum=5.0, maximum=20.0, step=1)
|
| 62 |
+
num_inference_steps_input = gr.Slider(value=12, label="num_inference_steps", minimum=1, maximum=12, step=1)
|
| 63 |
+
large_input = gr.Checkbox(False, label="Large (1024x1024)")
|
| 64 |
+
seed_input = gr.Slider(value=0, label="seed (0 for random)", minimum=0, maximum=1000000, step=42)
|
| 65 |
with gr.Row():
|
| 66 |
run_button = gr.Button("Generate Images")
|
| 67 |
with gr.Row():
|