Prgckwb commited on
Commit
9aa99b5
1 Parent(s): 58cedc4

:tada: change some process

Browse files
app.py CHANGED
@@ -42,9 +42,16 @@ def load_pipeline(model_id, use_model_offload, safety_checker):
42
  )
43
 
44
  # Load Textual Inversion
45
- pipe.load_textual_inversion('checkpoints/embeddings/BadNegAnatomyV1 neg.pt', token='BadNegAnatomyV1-neg')
46
- pipe.load_textual_inversion('checkpoints/embeddings/Deep Negative V1 75T.pt', token='DeepNegativeV1')
47
- pipe.load_textual_inversion('checkpoints/embeddings/easynegative.safetensors', token='EasyNegative')
 
 
 
 
 
 
 
48
 
49
  # VRAM が少ないとき用の対策
50
  if use_model_offload:
@@ -83,10 +90,15 @@ def inference(
83
  tokenizer=pipe.tokenizer,
84
  text_encoder=pipe.text_encoder,
85
  textual_inversion_manager=textual_inversion_manager,
 
86
  )
87
  prompt_embed = compel_procs(prompt)
88
  negative_prompt_embed = compel_procs(negative_prompt)
89
 
 
 
 
 
90
  generator = torch.Generator(device=device).manual_seed(seed)
91
 
92
  progress(0.3, 'Generating images...')
 
42
  )
43
 
44
  # Load Textual Inversion
45
+ pipe.load_textual_inversion("checkpoints/embeddings/BadNegAnatomyV1 neg.pt", token='BadNegAnatomyV1-neg')
46
+ pipe.load_textual_inversion("checkpoints/embeddings/Deep Negative V1 75T.pt", token='DeepNegative')
47
+ pipe.load_textual_inversion("checkpoints/embeddings/easynegative.safetensors", token='EasyNegative')
48
+ pipe.load_textual_inversion("checkpoints/embeddings/Negative Hand Embedding.pt", token='negative_hand-neg')
49
+
50
+ # Load LoRA
51
+ pipe.load_lora_weights("checkpoints/lora/detailed style SD1.5.safetensors", adapter_name='detail')
52
+ pipe.load_lora_weights("checkpoints/lora/perfection style SD1.5.safetensors", adapter_name='perfection')
53
+ pipe.load_lora_weights("checkpoints/lora/Hand v3 SD1.5.safetensors", adapter_name='hands')
54
+ pipe.set_adapters(['detail', 'hands'], adapter_weights=[0.5, 0.5])
55
 
56
  # VRAM が少ないとき用の対策
57
  if use_model_offload:
 
90
  tokenizer=pipe.tokenizer,
91
  text_encoder=pipe.text_encoder,
92
  textual_inversion_manager=textual_inversion_manager,
93
+ truncate_long_prompts=False,
94
  )
95
  prompt_embed = compel_procs(prompt)
96
  negative_prompt_embed = compel_procs(negative_prompt)
97
 
98
+ prompt_embed, negative_prompt_embed = compel_procs.pad_conditioning_tensors_to_same_length(
99
+ [prompt_embed, negative_prompt_embed]
100
+ )
101
+
102
  generator = torch.Generator(device=device).manual_seed(seed)
103
 
104
  progress(0.3, 'Generating images...')
checkpoints/embeddings/Negative Hand Embedding.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73b524a2da121eb1b7ad04dea11da286277813120700ff8f1d8522516f7b30ab
3
+ size 25533
src/example.py CHANGED
@@ -35,11 +35,15 @@ EXAMPLES = [
35
  prompt='A corgi wearing sunglasses says "U-Net is OVER!!"'
36
  ).to_list(),
37
  Example(
38
- prompt='Cinematic Photo of a beautiful korean fashion model bokeh train',
39
  model_id='Beautiful Realistic Asians',
40
- negative_prompt='(worst_quality)++, (BadNegAnatomyV1-neg), bradhands cartoon, cgi, render, illustration, painting, drawing',
41
- width=768,
42
- height=960,
 
 
 
 
43
  guidance_scale=5.0,
44
  num_inference_step=50,
45
  ).to_list()
 
35
  prompt='A corgi wearing sunglasses says "U-Net is OVER!!"'
36
  ).to_list(),
37
  Example(
38
+ prompt='Cinematic photo of a smiling beautiful Japanese fashion model',
39
  model_id='Beautiful Realistic Asians',
40
+ negative_prompt=(
41
+ "(worst_quality)++ (low quality)++ "
42
+ "(BadNegAnatomyV1-neg) (Deep Negative) (EasyNegative) (negative_hand-neg) "
43
+ "bradhands cartoon, cgi, render, illustration, painting, drawing"
44
+ ),
45
+ width=640,
46
+ height=1024,
47
  guidance_scale=5.0,
48
  num_inference_step=50,
49
  ).to_list()