Krebzonide commited on
Commit
809a5ae
·
1 Parent(s): 47bb23f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -23,16 +23,18 @@ def generate(prompt, samp_steps, seed, progress=gr.Progress(track_tqdm=True)):
23
  num_inference_steps=1,
24
  guidance_scale=0.0,
25
  generator=torch.manual_seed(seed),
26
- ).images
27
- upscaled_image = image[0].resize((1024,1024), 1)
 
28
  final_image = img2img(
29
  prompt,
 
30
  num_inference_steps=samp_steps,
31
  guidance_scale=5,
32
  strength=0.5,
33
  generator=torch.manual_seed(seed),
34
- ).images
35
- return gr.update(value = (final_image[0], f"Image: {prompt}")), seed
36
 
37
  def set_base_models():
38
  txt2img = AutoPipelineForText2Image.from_pretrained(
 
23
  num_inference_steps=1,
24
  guidance_scale=0.0,
25
  generator=torch.manual_seed(seed),
26
+ output_type="latent"
27
+ ).images[0]
28
+ upscaled_image = image.resize((1024,1024), 1)
29
  final_image = img2img(
30
  prompt,
31
+ upscaled_image,
32
  num_inference_steps=samp_steps,
33
  guidance_scale=5,
34
  strength=0.5,
35
  generator=torch.manual_seed(seed),
36
+ ).images[0]
37
+ return gr.update(value = (final_image, f"Image: {prompt}")), seed
38
 
39
  def set_base_models():
40
  txt2img = AutoPipelineForText2Image.from_pretrained(