Gemini899 commited on
Commit
da8c4b3
·
verified ·
1 Parent(s): ca49c90

Upload 12 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,11 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ examples/draw_input.jpg filter=lfs diff=lfs merge=lfs -text
37
+ examples/draw_output.jpg filter=lfs diff=lfs merge=lfs -text
38
+ examples/draw-gimp_input.jpg filter=lfs diff=lfs merge=lfs -text
39
+ examples/draw-gimp_output.jpg filter=lfs diff=lfs merge=lfs -text
40
+ examples/gimp_input.jpg filter=lfs diff=lfs merge=lfs -text
41
+ examples/gimp_output.jpg filter=lfs diff=lfs merge=lfs -text
42
+ examples/inpaint_input.jpg filter=lfs diff=lfs merge=lfs -text
43
+ examples/inpaint_output.jpg filter=lfs diff=lfs merge=lfs -text
demo_footer.html ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ <div>
2
+ <P> Images are generated with <a href="https://huggingface.co/black-forest-labs/FLUX.1-schnell">FLUX.1-schnell</a> and licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">the Apache 2.0 License</a>
3
+ </div>
demo_header.html ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div style="text-align: center;">
2
+ <h1>
3
+ Flux.1-schnell img2img
4
+ </h1>
5
+ <div class="grid-container">
6
+ <img src="https://akjava.github.io/AIDiagramChatWithVoice-FaceCharacter/webp/128/00349245_09_00002200.webp" alt="Flux.1-schnell-WebP3Frame-TalkingAnimation" class="image">
7
+ <p class="text">
8
+ Img2Img has much potential <a href="https://huggingface.co/spaces/Akjava/CreateConsistentCharacterFacialAnimationWithImg2Img" target="_blank">Create Consistent Character Facial Animation with Img2Img</a><br> Simple Classic Inapint result are good.but plain drawing is not so good,You can get best result with Gimp's Smudge Tool<br>
9
+ Img2img is good for scale-up too ,the result is more better with Gimp's sharpen<br>
10
+ Basically output face is totally difference,scale up to image to reduce that<br>
11
+ Usually result color strange,use Whitebalance tools or gimp<br>
12
+ you can clear face coverd hand with img2img + inpaint
13
+ </p>
14
+ </div>
15
+ </div>
16
+
demo_tools.html ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div style="text-align: center;">
2
+ <p><a href="https://huggingface.co/spaces/Akjava/AIDiagramChatWithVoice-FaceCharacter">AI Diagram Chat with Voice/Face Character Making Tools</a></p>
3
+ <p><a href="https://huggingface.co/spaces/Akjava/WebPTalkHead">[WebP-3F-TH]</a>
4
+ <a href="https://huggingface.co/spaces/Akjava/flux1-schnell-img2img">[Flux1-Img2Img(GPU)]</a>
5
+ <a href="https://huggingface.co/spaces/Akjava/flux1-schnell-mask-inpaint">[Flux1-Inpaint(GPU)]</a>
6
+ <a href="https://huggingface.co/spaces/Akjava/OpenCVInpaintCPU">[OpenCV-Inapint]</a>
7
+ <a href="https://huggingface.co/spaces/Akjava/Simple-Whitebalance-Image">[Whitebalance]</a>
8
+ <a href="https://huggingface.co/spaces/Akjava/Simple-Mask-Paste-Image">[Paste Image]</a>
9
+ <a href=" https://huggingface.co/spaces/Akjava/WebP-Resize-Convert">[WebP Resize Convert]</a></p>
10
+ </div>
examples/draw-gimp_input.jpg ADDED

Git LFS Details

  • SHA256: 3d2a5a03c6731b59a92fadc1ba3118b879ef7ebe8dd4d0771f72bcb4a33b05d0
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
examples/draw-gimp_output.jpg ADDED

Git LFS Details

  • SHA256: e7044a2dc76f68b35216dabf901556ed7a53da5a251b205ab46ded4b9eee5ade
  • Pointer size: 131 Bytes
  • Size of remote file: 128 kB
examples/draw_input.jpg ADDED

Git LFS Details

  • SHA256: 1e3b8b4a1f8eb597fee6dc2ed8470a3832c0f5436ea070a9e9e19124ab63d9f1
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB
examples/draw_output.jpg ADDED

Git LFS Details

  • SHA256: ea55907bac1c2b283226c0ca84809f46da10ab2249b311efc18f428a2d616572
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
examples/gimp_input.jpg ADDED

Git LFS Details

  • SHA256: 28319cda38b58ebf6e11533e777845209b6cc53622378cfab9533669f28d2d55
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB
examples/gimp_output.jpg ADDED

Git LFS Details

  • SHA256: c850eb1f068148d68727ab7f0d52a876fecd53ccbf5613413b70d35e05b3b476
  • Pointer size: 131 Bytes
  • Size of remote file: 167 kB
examples/inpaint_input.jpg ADDED

Git LFS Details

  • SHA256: 4d7a9126ce0581bc7459be2c9f705827547f3df4233d46aab7f06b1fa408a9e3
  • Pointer size: 131 Bytes
  • Size of remote file: 134 kB
examples/inpaint_output.jpg ADDED

Git LFS Details

  • SHA256: f65219633eeeac92af925a5bdc7c6b4827bee728db2e58f936ba4c95f8e960f7
  • Pointer size: 131 Bytes
  • Size of remote file: 150 kB
flux1_img2img.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from diffusers import FluxImg2ImgPipeline
3
+
4
+ from PIL import Image
5
+ import sys
6
+ import spaces
7
+
8
+ # I only test with FLUX.1-schnell
9
+
10
+ @spaces.GPU
11
+ def process_image(image,mask_image,prompt="a person",model_id="black-forest-labs/FLUX.1-schnell",strength=0.75,seed=0,num_inference_steps=4):
12
+ print("start process image process_image")
13
+ if image == None:
14
+ print("empty input image returned")
15
+ return None
16
+
17
+ pipe = FluxImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
18
+ pipe.to("cuda")
19
+
20
+ generators = []
21
+ generator = torch.Generator("cuda").manual_seed(seed)
22
+ generators.append(generator)
23
+ # more parameter see https://huggingface.co/docs/diffusers/api/pipelines/flux#diffusers.FluxInpaintPipeline
24
+ print(prompt)
25
+ output = pipe(prompt=prompt, image=image,generator=generator,strength=strength
26
+ ,guidance_scale=0,num_inference_steps=num_inference_steps,max_sequence_length=256)
27
+
28
+ # TODO support mask
29
+ return output.images[0]
30
+
31
+ if __name__ == "__main__":
32
+ #args input-image input-mask output
33
+ image = Image.open(sys.argv[1])
34
+ mask = Image.open(sys.argv[2])
35
+ output = process_image(image,mask)
36
+ output.save(sys.argv[3])