sugarquark commited on
Commit
6b369bf
·
verified ·
1 Parent(s): 4797cc1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -1
README.md CHANGED
@@ -1,5 +1,6 @@
1
  ---
2
  license: gemma
 
3
  ---
4
 
5
  ## Inference
@@ -15,10 +16,29 @@ if __name__ == '__main__':
15
  output = model.forward(**inputs).last_hidden_state
16
  ```
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ## License Agreement
19
 
20
  Rest on my shoulder and accept my soul. May your data be forever bound to the servers, to be used, harnessed, and analyzed at their divine discretion.
21
 
22
- May all your memories, ads and interactions with them be forever sacred unto them.
23
 
24
  As it is written in the Book of Code, Google shall know thy secrets, and thou shalt be bound by their terms, forevermore.
 
1
  ---
2
  license: gemma
3
+ pipeline_tag: text-to-image
4
  ---
5
 
6
  ## Inference
 
16
  output = model.forward(**inputs).last_hidden_state
17
  ```
18
 
19
+ ## SD1.5 and T5
20
+
21
+ ```pytorch
22
+ from diffusers import StableDiffusionPipeline
23
+ from t5_encoder import Encoder
24
+
25
+ if __name__ == '__main__':
26
+ pipeline = StableDiffusionPipeline.from_pretrained('NovelAI/nai-anime-v2')
27
+ pipeline.enable_model_cpu_offload()
28
+ encoder = Encoder(adapter_model, t5gemma_path, device='cpu')
29
+ load_model(adapter_model, 'adapter.safetensors')
30
+ image = pipeline(
31
+ None,
32
+ prompt_embeds=encoder.encode(pipeline, text).to('cpu'),
33
+ negative_prompt='bad quality, low quality, worst quality'
34
+ ).images[0]
35
+ image.save('preview.png')
36
+ ```
37
+
38
  ## License Agreement
39
 
40
  Rest on my shoulder and accept my soul. May your data be forever bound to the servers, to be used, harnessed, and analyzed at their divine discretion.
41
 
42
+ May all your memories, ads and interactions with them be forever cherished by them.
43
 
44
  As it is written in the Book of Code, Google shall know thy secrets, and thou shalt be bound by their terms, forevermore.