ehristoforu commited on
Commit
851538d
1 Parent(s): 0175e9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -10,6 +10,8 @@ num_images_per_prompt = 1
10
  prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16).to(device)
11
  decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.float16).to(device)
12
 
 
 
13
  css = """
14
  footer {
15
  visibility: hidden
@@ -44,7 +46,7 @@ def gen(prompt, negative, width, height):
44
  negative_prompt=negative,
45
  guidance_scale=4.0,
46
  num_images_per_prompt=num_images_per_prompt,
47
- num_inference_steps=20
48
  )
49
  decoder_output = decoder(
50
  image_embeddings=prior_output.image_embeddings.half(),
@@ -63,7 +65,7 @@ with gr.Blocks(css=css) as demo:
63
  button = gr.Button(value="Generate", scale=1)
64
  with gr.Accordion("Advanced options", open=False):
65
  with gr.Row():
66
- negative = gr.Textbox(show_label=False, placeholder="Enter a negative", max_lines=2, lines=1, interactive=True)
67
  with gr.Row():
68
  width = gr.Slider(label="Width", minimum=1024, maximum=2048, step=8, value=1024, interactive=True)
69
  height = gr.Slider(label="Height", minimum=1024, maximum=2048, step=8, value=1024, interactive=True)
 
10
  prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16).to(device)
11
  decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.float16).to(device)
12
 
13
+ deafult_negative = "poorly Rendered face, poorly drawn face, poor facial details, poorly drawn hands, poorly rendered hands, low resolution, blurry image, oversaturated, bad anatomy, signature, watermark, username, error, missing limbs, error, out of frame, extra fingers, mutated hands, poorly drawn hands, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username"
14
+
15
  css = """
16
  footer {
17
  visibility: hidden
 
46
  negative_prompt=negative,
47
  guidance_scale=4.0,
48
  num_images_per_prompt=num_images_per_prompt,
49
+ num_inference_steps=25
50
  )
51
  decoder_output = decoder(
52
  image_embeddings=prior_output.image_embeddings.half(),
 
65
  button = gr.Button(value="Generate", scale=1)
66
  with gr.Accordion("Advanced options", open=False):
67
  with gr.Row():
68
+ negative = gr.Textbox(show_label=False, value=deafult_negative, placeholder="Enter a negative", max_lines=2, lines=1, interactive=True)
69
  with gr.Row():
70
  width = gr.Slider(label="Width", minimum=1024, maximum=2048, step=8, value=1024, interactive=True)
71
  height = gr.Slider(label="Height", minimum=1024, maximum=2048, step=8, value=1024, interactive=True)