wsj1995 commited on
Commit
460c461
·
verified ·
1 Parent(s): 2f73345

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -12
app.py CHANGED
@@ -25,18 +25,27 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
25
  if randomize_seed:
26
  seed = random.randint(0, MAX_SEED)
27
  generator = torch.Generator().manual_seed(seed)
28
-
29
- for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
30
- prompt=prompt,
31
- guidance_scale=guidance_scale,
32
- num_inference_steps=num_inference_steps,
33
- width=width,
34
- height=height,
35
- generator=generator,
36
- output_type="pil",
37
- good_vae=good_vae,
38
- ):
39
- yield img, seed
 
 
 
 
 
 
 
 
 
40
 
41
  examples = [
42
  "a tiny astronaut hatching from an egg on the moon",
 
25
  if randomize_seed:
26
  seed = random.randint(0, MAX_SEED)
27
  generator = torch.Generator().manual_seed(seed)
28
+ image = pipe(
29
+ prompt,
30
+ height=1024,
31
+ width=1024,
32
+ guidance_scale=3.5,
33
+ num_inference_steps=50,
34
+ max_sequence_length=512,
35
+ generator=torch.Generator("cpu").manual_seed(0)
36
+ ).images[0]
37
+ return image
38
+ # for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
39
+ # prompt=prompt,
40
+ # guidance_scale=guidance_scale,
41
+ # num_inference_steps=num_inference_steps,
42
+ # width=width,
43
+ # height=height,
44
+ # generator=generator,
45
+ # output_type="pil",
46
+ # good_vae=good_vae,
47
+ # ):
48
+ # yield img, seed
49
 
50
  examples = [
51
  "a tiny astronaut hatching from an egg on the moon",