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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -12
app.py CHANGED
@@ -45,21 +45,33 @@ def run(image, src_style, src_prompt, prompts, shared_score_shift, shared_score_
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 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
  with gr.Row():
50
- gr.Image(label="Reference image", type="pil")
51
  with gr.Row():
52
- gr.Textbox(label="Describe the reference style")
53
- gr.Textbox(label="Describe the reference image")
54
- gr.Textbox(label="Prompts to generate images (separate with new lines)", lines=5)
55
  with gr.Accordion(label="Advanced Settings"):
56
  with gr.Row():
57
- gr.Slider(value=1.1, label="shared_score_shift", minimum=1.0, maximum=2.0, step=0.05)
58
- gr.Slider(value=1.0, label="shared_score_scale", minimum=0.0, maximum=1.0, step=0.05)
59
- gr.Slider(value=10.0, label="guidance_scale", minimum=5.0, maximum=20.0, step=1)
60
- gr.Slider(value=12, label="num_inference_steps", minimum=1, maximum=12, step=1)
61
- gr.Checkbox(False, label="Large (1024x1024)")
62
- gr.Slider(value=0, label="seed (0 for random)", minimum=0, maximum=1000000, step=42)
63
  with gr.Row():
64
  run_button = gr.Button("Generate Images")
65
  with gr.Row():
@@ -71,4 +83,4 @@ with gr.Blocks() as demo:
71
  outputs=output_gallery
72
  )
73
 
74
- demo.launch()
 
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():
 
83
  outputs=output_gallery
84
  )
85
 
86
+ demo.launch()