hsuwill000 commited on
Commit
6e102d5
·
verified ·
1 Parent(s): b4aea0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -40
app.py CHANGED
@@ -26,12 +26,6 @@ WIDTH=512
26
 
27
  batch_size = -1
28
 
29
- class CustomOVModelVaeDecoder(OVModelVaeDecoder):
30
- def __init__(
31
- self, model: ov.Model, parent_model: OVBaseModel, ov_config: Optional[Dict[str, str]] = None, model_dir: str = None,
32
- ):
33
- super(OVModelVaeDecoder, self).__init__(model, parent_model, ov_config, "vae_decoder", model_dir)
34
-
35
 
36
 
37
  pipe = OVStableDiffusionPipeline.from_pretrained(
@@ -46,28 +40,8 @@ pipe = OVStableDiffusionPipeline.from_pretrained(
46
  )
47
  print(pipe.scheduler.compatibles)
48
 
49
- #pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
50
- #pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
51
-
52
- #pipe.load_lora_weights(adapter_id)
53
- #pipe.fuse_lora()
54
- taesd_dir = snapshot_download(repo_id="deinferno/taesd-openvino")
55
-
56
- pipe.vae_decoder = CustomOVModelVaeDecoder(model = OVBaseModel.load_model(f"{taesd_dir}/vae_decoder/openvino_model.xml"),
57
- parent_model = pipe,
58
- model_dir = taesd_dir
59
- )
60
-
61
-
62
 
63
  pipe.reshape( batch_size=-1, height=HIGH, width=WIDTH, num_images_per_prompt=1)
64
- #pipe.load_textual_inversion("./badhandv4.pt", "badhandv4")
65
- #pipe.load_textual_inversion("./Konpeto.pt", "Konpeto")
66
- #<shigure-ui-style>
67
- #pipe.load_textual_inversion("sd-concepts-library/shigure-ui-style")
68
- #pipe.load_textual_inversion("sd-concepts-library/ruan-jia")
69
- #pipe.load_textual_inversion("sd-concepts-library/agm-style-nao")
70
-
71
 
72
  pipe.compile()
73
 
@@ -89,13 +63,6 @@ def infer(prompt,negative_prompt):
89
  return image
90
 
91
 
92
- examples = [
93
- "(Digital art, highres, best quality, 8K, masterpiece, anime screencap, perfect eyes:1.4, ultra detailed:1.5),1girl,flat chest,short messy pink hair,blue eyes,tall,thick thighs,light blue hoodie,collar,light blue shirt,black sport shorts,bulge,black thigh highs,femboy,okoto no ko,smiling,blushing,looking at viewer,inside,livingroom,sitting on couch,nighttime,dark,hand_to_mouth,",
94
- "1girl, silver hair, symbol-shaped pupils, yellow eyes, smiling, light particles, light rays, star guardian, serious face, red inner hair, power aura, grandmaster1, golden and white clothes",
95
- "masterpiece, best quality, highres booru, 1girl, solo, depth of field, rim lighting, flowers, petals, from above, crystals, butterfly, vegetation, aura, magic, hatsune miku, blush, slight smile, close-up, against wall,",
96
- "((colofrul:1.7)),((best quality)), ((masterpiece)), ((ultra-detailed)), (illustration), (detailed light), (an extremely delicate and beautiful),incredibly_absurdres,(glowing),(1girl:1.7),solo,a beautiful girl,(((cowboy shot))),standding,((Hosiery)),((beautiful off-shoulder lace-trimmed layered strapless dress+white stocking):1.25),((Belts)),(leg loops),((Hosiery)),((flower headdress)),((long white hair)),(((beautiful eyes))),BREAK,((english text)),(flower:1.35),(garden),(((border:1.75))),",
97
- ]
98
-
99
  css="""
100
  #col-container {
101
  margin: 0 auto;
@@ -126,13 +93,6 @@ with gr.Blocks(css=css) as demo:
126
 
127
  result = gr.Image(label="Result", show_label=False)
128
 
129
- gr.Examples(
130
- examples = examples,
131
- fn = infer,
132
- inputs = [prompt],
133
- outputs = [result]
134
- )
135
-
136
  run_button.click(
137
  fn = infer,
138
  inputs = [prompt],
 
26
 
27
  batch_size = -1
28
 
 
 
 
 
 
 
29
 
30
 
31
  pipe = OVStableDiffusionPipeline.from_pretrained(
 
40
  )
41
  print(pipe.scheduler.compatibles)
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  pipe.reshape( batch_size=-1, height=HIGH, width=WIDTH, num_images_per_prompt=1)
 
 
 
 
 
 
 
45
 
46
  pipe.compile()
47
 
 
63
  return image
64
 
65
 
 
 
 
 
 
 
 
66
  css="""
67
  #col-container {
68
  margin: 0 auto;
 
93
 
94
  result = gr.Image(label="Result", show_label=False)
95
 
 
 
 
 
 
 
 
96
  run_button.click(
97
  fn = infer,
98
  inputs = [prompt],