zs38 commited on
Commit
1010ff1
·
1 Parent(s): 135aa5d
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -57,8 +57,10 @@ IMAGE_PROCESS_TRANSFORM = transforms.Compose([
57
  ])
58
 
59
  @spaces.GPU
60
- def generate_image(ref_image, ref_image2, prompt, height=512, width=512, num_steps=25, guidance_scale=3.5, seed=0, ip_scale=1.0):
61
- print(f"ref_image: {ref_image.size}, prompt: {prompt}, height: {height}, width: {width}, num_steps: {num_steps}, guidance_scale: {guidance_scale}, ip_scale: {ip_scale}")
 
 
62
  with torch.no_grad():
63
  image_refs = map(torch.stack, [
64
  [IMAGE_PROCESS_TRANSFORM(i) for i in [ref_image, ref_image2] if i is not None]
@@ -95,7 +97,7 @@ with gr.Blocks() as demo:
95
  with gr.Row():
96
  gr.Markdown("""
97
  ## Character Consistancy Image Generation based on Flux
98
- - This model is continuously improving until it meets high standards for open-sourcing, currently good enough at generating consistent images of single human subject.
99
  """)
100
 
101
  with gr.Row():
@@ -141,8 +143,7 @@ with gr.Blocks() as demo:
141
  ### Tips:
142
  - Images with human subjects tend to perform better than other categories.
143
  - Images where the subject occupies most of the frame with a clean, uncluttered background yield improved results.
144
- - Including multiple subjects of the same category may cause blending issues (this is being improved).
145
- - Despite these factors, most image inputs still produce reasonable and satisfactory results.
146
  """)
147
  # When the button is clicked, pass all inputs to generate_image
148
  generate_btn.click(
 
57
  ])
58
 
59
  @spaces.GPU
60
+ def generate_image(ref_image, ref_image2=None, prompt="", height=512, width=512, num_steps=25, guidance_scale=3.5, seed=0, ip_scale=1.0):
61
+ print(f"ref_image: {ref_image.size if ref_image is not None else None}, "
62
+ f"ref_image2: {ref_image2.size if ref_image2 is not None else None}, "
63
+ f"prompt: {prompt}, height: {height}, width: {width}, num_steps: {num_steps}, guidance_scale: {guidance_scale}, ip_scale: {ip_scale}")
64
  with torch.no_grad():
65
  image_refs = map(torch.stack, [
66
  [IMAGE_PROCESS_TRANSFORM(i) for i in [ref_image, ref_image2] if i is not None]
 
97
  with gr.Row():
98
  gr.Markdown("""
99
  ## Character Consistancy Image Generation based on Flux
100
+ - This model is currently only good at generating consistent images of single human subject, multi-subjects and common object are not as satisfactory, but it will improved soon
101
  """)
102
 
103
  with gr.Row():
 
143
  ### Tips:
144
  - Images with human subjects tend to perform better than other categories.
145
  - Images where the subject occupies most of the frame with a clean, uncluttered background yield improved results.
146
+ - Including multiple subjects of the same category may cause blending issues.
 
147
  """)
148
  # When the button is clicked, pass all inputs to generate_image
149
  generate_btn.click(