HelloSun commited on
Commit
5effd4d
·
verified ·
1 Parent(s): 934c4a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -12,11 +12,11 @@ pipe = OVStableDiffusionPipeline.from_pretrained(model_id, compile=False)
12
  pipe.reshape( batch_size=1, height=256, width=256, num_images_per_prompt=1)
13
  pipe.compile()
14
 
15
- def infer(prompt):
16
 
17
  image = pipe(
18
  prompt = prompt,
19
- negative_prompt = "score_6,score_5,score_4,source_furry,pathway,walkway,face mask,heterochromia,tattoos,muscular,deformed iris,deformed pupils,long body,long neck,text,error,print,signature,logo,watermark,deformed,distorted,disfigured,bad anatomy,wrong anatomy,ugly,disgusting,cropped,crooked teeth,multiple views,bad proportions,gross proportions,cloned face,worst quality,low quality,normal quality,bad quality,lowres,poorly drawn,semi-realistic,3d,render,cg,cgi,imperfect,partial,unfinished,incomplete,monochrome,grayscale,sepia,fat,wrinkle,fat leg,fat ass,loli,blurry,hazy,sagging breasts,loli,child,longbody,lowres,bad anatomy,bad hands,missing fingers,extra digit,fewer digits,worst quality,low quality,normal quality,watermark,artist name,signature,",
20
  width = 256,
21
  height = 256,
22
  ).images[0]
@@ -43,12 +43,11 @@ with gr.Blocks(css=css) as demo:
43
 
44
  with gr.Column(elem_id="col-container"):
45
  gr.Markdown(f"""
46
- # Text-to-Image Gradio Template
47
  Currently running on {power_device}.
48
  """)
49
 
50
  with gr.Row():
51
-
52
  prompt = gr.Text(
53
  label="Prompt",
54
  show_label=False,
@@ -56,7 +55,14 @@ with gr.Blocks(css=css) as demo:
56
  placeholder="Enter your prompt",
57
  container=False,
58
  )
59
-
 
 
 
 
 
 
 
60
  run_button = gr.Button("Run", scale=0)
61
 
62
  result = gr.Image(label="Result", show_label=False)
@@ -68,7 +74,7 @@ with gr.Blocks(css=css) as demo:
68
 
69
  run_button.click(
70
  fn = infer,
71
- inputs = [prompt],
72
  outputs = [result]
73
  )
74
 
 
12
  pipe.reshape( batch_size=1, height=256, width=256, num_images_per_prompt=1)
13
  pipe.compile()
14
 
15
+ def infer(prompt,negative_prompt):
16
 
17
  image = pipe(
18
  prompt = prompt,
19
+ negative_prompt = negative_prompt,
20
  width = 256,
21
  height = 256,
22
  ).images[0]
 
43
 
44
  with gr.Column(elem_id="col-container"):
45
  gr.Markdown(f"""
46
+ # Linaqruf-anything-v3.0-ov 256x256
47
  Currently running on {power_device}.
48
  """)
49
 
50
  with gr.Row():
 
51
  prompt = gr.Text(
52
  label="Prompt",
53
  show_label=False,
 
55
  placeholder="Enter your prompt",
56
  container=False,
57
  )
58
+ with gr.Row():
59
+ negative_prompt = gr.Text(
60
+ label="negative_prompt",
61
+ show_label=False,
62
+ max_lines=1,
63
+ placeholder="Enter your prompt",
64
+ container=False,
65
+ )
66
  run_button = gr.Button("Run", scale=0)
67
 
68
  result = gr.Image(label="Result", show_label=False)
 
74
 
75
  run_button.click(
76
  fn = infer,
77
+ inputs = [prompt,negative_prompt],
78
  outputs = [result]
79
  )
80