aifeifei798 commited on
Commit
983c55a
1 Parent(s): 6a587db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -10
app.py CHANGED
@@ -49,18 +49,31 @@ css="""
49
  def infer(prompt, seed=42, randomize_seed=False, width=896, height=1152, num_inference_steps=16, progress=gr.Progress(track_tqdm=True), guidancescale=3.5):
50
  if randomize_seed:
51
  seed = random.randint(0, MAX_SEED)
 
52
  generator = torch.Generator().manual_seed(seed)
53
- image = pipe(
54
- prompt = prompt,
55
- width = width,
56
- height = height,
57
- num_inference_steps = num_inference_steps,
58
- generator = generator,
59
- guidance_scale=guidancescale,
 
 
 
 
 
 
 
 
 
 
 
60
  output_type="pil",
61
- ).images[0]
62
- # image = good_vae.decode(image, return_dict=False)[0]
63
- return image, seed
 
64
 
65
  def encode_image(image_path):
66
  """Encode the image to base64."""
 
49
  def infer(prompt, seed=42, randomize_seed=False, width=896, height=1152, num_inference_steps=16, progress=gr.Progress(track_tqdm=True), guidancescale=3.5):
50
  if randomize_seed:
51
  seed = random.randint(0, MAX_SEED)
52
+
53
  generator = torch.Generator().manual_seed(seed)
54
+
55
+ #image = pipe(
56
+ # prompt = prompt,
57
+ # width = width,
58
+ # height = height,
59
+ # num_inference_steps = num_inference_steps,
60
+ # generator = generator,
61
+ # guidance_scale=guidancescale,
62
+ # output_type="pil",
63
+ #).images[0]
64
+ #return image, seed
65
+ for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
66
+ prompt=prompt,
67
+ guidance_scale=guidance_scale,
68
+ num_inference_steps=num_inference_steps,
69
+ width=width,
70
+ height=height,
71
+ generator=generator,
72
  output_type="pil",
73
+ good_vae=good_vae,
74
+ ):
75
+ yield img, seed
76
+
77
 
78
  def encode_image(image_path):
79
  """Encode the image to base64."""