Krebzonide commited on
Commit
392b88f
·
1 Parent(s): ea3b1d6

Remove refiner

Browse files

It didn’t work and I see almost no difference in the online example images anyway

Files changed (1) hide show
  1. app.py +1 -18
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from diffusers import StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline, AutoencoderKL
2
  import torch
3
  import random
4
  #from controlnet_aux import OpenposeDetector
@@ -27,15 +27,6 @@ pipe = StableDiffusionXLPipeline.from_single_file(
27
  )
28
  pipe.enable_model_cpu_offload()
29
 
30
- pipeRefiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
31
- "stabilityai/stable-diffusion-xl-refiner-1.0",
32
- torch_dtype=torch.float16,
33
- variant="fp16",
34
- vae=vae,
35
- use_safetensors=True
36
- )
37
- pipeRefiner.enable_model_cpu_offload()
38
-
39
  css = """
40
  .btn-green {
41
  background-image: linear-gradient(to bottom right, #6dd178, #00a613) !important;
@@ -60,14 +51,6 @@ def generate(prompt, neg_prompt, samp_steps, guide_scale, batch_size, seed, heig
60
  height=height,
61
  width=width,
62
  generator=torch.manual_seed(seed),
63
- output_type="latent",
64
- denoising_end=0.8
65
- ).images
66
- images = pipeRefiner(
67
- prompt,
68
- image=images,
69
- num_inference_steps=samp_steps,
70
- denoising_start=0.8
71
  ).images
72
  return [(img, f"Image {i+1}") for i, img in enumerate(imagesRefined)]
73
 
 
1
+ from diffusers import StableDiffusionXLPipeline, AutoencoderKL
2
  import torch
3
  import random
4
  #from controlnet_aux import OpenposeDetector
 
27
  )
28
  pipe.enable_model_cpu_offload()
29
 
 
 
 
 
 
 
 
 
 
30
  css = """
31
  .btn-green {
32
  background-image: linear-gradient(to bottom right, #6dd178, #00a613) !important;
 
51
  height=height,
52
  width=width,
53
  generator=torch.manual_seed(seed),
 
 
 
 
 
 
 
 
54
  ).images
55
  return [(img, f"Image {i+1}") for i, img in enumerate(imagesRefined)]
56