KingNish commited on
Commit
ed1a78a
Β·
verified Β·
1 Parent(s): e29ad48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -6,12 +6,11 @@ import gradio as gr
6
  import numpy as np
7
  import torch
8
  from PIL import Image
9
- from diffusers import DiffusionPipeline, StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler, StableDiffusionXLInstructPix2PixPipeline, AutoencoderKL
10
  from custom_pipeline import CosStableDiffusionXLInstructPix2PixPipeline
11
  from huggingface_hub import hf_hub_download
12
  from huggingface_hub import InferenceClient
13
 
14
- device = "cuda" if torch.cuda.is_available() else "cpu"
15
  dtype = torch.float16
16
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
17
 
@@ -34,8 +33,7 @@ To optimize image results:
34
  """
35
 
36
  # Image Editor
37
- pipe_edit = StableDiffusionXLInstructPix2PixPipeline.from_pretrained( "vinesmsuic/magicbrush-jul7", torch_dtype=torch.float16, vae=vae ).to("cuda")
38
-
39
 
40
  # Generator
41
  @spaces.GPU(duration=30, queue=False)
 
6
  import numpy as np
7
  import torch
8
  from PIL import Image
9
+ from diffusers import DiffusionPipeline, StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler, StableDiffusionInstructPix2PixPipeline, AutoencoderKL
10
  from custom_pipeline import CosStableDiffusionXLInstructPix2PixPipeline
11
  from huggingface_hub import hf_hub_download
12
  from huggingface_hub import InferenceClient
13
 
 
14
  dtype = torch.float16
15
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
16
 
 
33
  """
34
 
35
  # Image Editor
36
+ pipe_edit = StableDiffusionInstructPix2PixPipeline.from_pretrained( "vinesmsuic/magicbrush-jul7", torch_dtype=torch.float16 ).to("cuda")
 
37
 
38
  # Generator
39
  @spaces.GPU(duration=30, queue=False)