Tonic commited on
Commit
db96f54
β€’
1 Parent(s): a1eca34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -21
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.display()
63
  with gr.Row():
64
- style_input.display()
65
- image_desc_input.display()
66
- prompts_input.display()
67
  with gr.Accordion(label="Advanced Settings"):
68
  with gr.Row():
69
- shared_score_shift_input.display()
70
- shared_score_scale_input.display()
71
- guidance_scale_input.display()
72
- num_inference_steps_input.display()
73
- large_input.display()
74
- seed_input.display()
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():