svjack commited on
Commit
3a0d002
·
verified ·
1 Parent(s): 1fbb456

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Genshin_Impact_VENTI_Flex2_Lora
2
+
3
+
4
+ ## Installtion
5
+ ```bash
6
+ pip install -U diffusers transformers torch sentencepiece peft controlnet-aux moviepy protobuf
7
+ ```
8
+
9
+ ## Demo
10
+ ```python
11
+ #import os
12
+ #os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
13
+
14
+ #### git clone https://huggingface.co/ostris/Flex.2-preview
15
+
16
+ import torch
17
+ from diffusers import AutoPipelineForText2Image
18
+ from diffusers.utils import load_image
19
+
20
+ #name_or_path = "ostris/Flex.2-preview"
21
+ name_or_path = "Flex.2-preview"
22
+ dtype = torch.bfloat16
23
+
24
+ pipe = AutoPipelineForText2Image.from_pretrained(
25
+ name_or_path,
26
+ custom_pipeline=name_or_path,
27
+ torch_dtype=dtype
28
+ )
29
+ pipe.load_lora_weights("Genshin_Impact_VENTI_Flex2_Lora/my_first_flex2_lora_v1_000001750.safetensors")
30
+ pipe.enable_sequential_cpu_offload()
31
+
32
+ import numpy as np
33
+ from PIL import Image
34
+ image = pipe(
35
+ prompt="VENTI answer calls with headphones",
36
+ inpaint_image=Image.fromarray(np.zeros((1024, 1024, 3)).astype(np.uint8)),
37
+ inpaint_mask=Image.fromarray(np.ones((1024, 1024, 3), dtype=np.uint8) * 255),
38
+ control_image=Image.fromarray(np.zeros((1024, 1024, 3)).astype(np.uint8)),
39
+ control_strength=0.5,
40
+ control_stop=0.33,
41
+ height=1024,
42
+ width=1024,
43
+ guidance_scale=3.5,
44
+ num_inference_steps=50,
45
+ generator=torch.Generator("cpu").manual_seed(42)
46
+ ).images[0]
47
+ image.save("calls_with_headphones.png")
48
+
49
+
50
+
51
+ ```
52
+
53
+
54
+
55
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/634dffc49b777beec3bc6448/VM9VooweD6rX5C_LeT8ZD.png)
56
+