ash123 commited on
Commit
9f9004a
·
1 Parent(s): 5d87a2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -35,7 +35,7 @@ def generate_image(prompt: str, negative_prompt: str = "", inference_steps: int
35
  prompt_ids = shard(prompt_ids)
36
 
37
  if negative_prompt == "":
38
- images = pipeline(
39
  prompt_ids=prompt_ids,
40
  params=p_params,
41
  prng_seed=rng,
@@ -49,7 +49,7 @@ def generate_image(prompt: str, negative_prompt: str = "", inference_steps: int
49
  neg_prompt_ids = pipeline.prepare_inputs(
50
  [negative_prompt] * num_samples)
51
  neg_prompt_ids = shard(neg_prompt_ids)
52
- images = pipeline(
53
  prompt_ids=prompt_ids,
54
  params=p_params,
55
  prng_seed=rng,
@@ -60,10 +60,7 @@ def generate_image(prompt: str, negative_prompt: str = "", inference_steps: int
60
  guidance_scale=float(guidance_scale),
61
  jit=True,
62
  ).images
63
- images_f = []
64
- image_b64 = (f"data:image/jpeg;base64,{images[0]}")
65
- images_f.append(image_b64)
66
- return images_f
67
 
68
  examples = [
69
  ["A watercolor painting of a bird"],
 
35
  prompt_ids = shard(prompt_ids)
36
 
37
  if negative_prompt == "":
38
+ image = pipeline(
39
  prompt_ids=prompt_ids,
40
  params=p_params,
41
  prng_seed=rng,
 
49
  neg_prompt_ids = pipeline.prepare_inputs(
50
  [negative_prompt] * num_samples)
51
  neg_prompt_ids = shard(neg_prompt_ids)
52
+ image = pipeline(
53
  prompt_ids=prompt_ids,
54
  params=p_params,
55
  prng_seed=rng,
 
60
  guidance_scale=float(guidance_scale),
61
  jit=True,
62
  ).images
63
+ return image
 
 
 
64
 
65
  examples = [
66
  ["A watercolor painting of a bird"],