Linoy Tsaban commited on
Commit
9b96547
1 Parent(s): 1fc5b9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -45,9 +45,9 @@ def sample(wt, zs, wts, prompt_tar="", cfg_scale_tar=15, skip=36, eta = 1):
45
  # load pipelines
46
  sd_model_id = "runwayml/stable-diffusion-v1-5"
47
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
48
- sd_pipe = StableDiffusionPipeline.from_pretrained(sd_model_id, torch_dtype=torch.float16).to(device)
49
  sd_pipe.scheduler = DDIMScheduler.from_config(sd_model_id, subfolder = "scheduler")
50
- sem_pipe = SemanticStableDiffusionPipeline.from_pretrained(sd_model_id,torch_dtype=torch.float16).to(device)
51
 
52
 
53
  def edit(input_image, input_image_prompt='', target_prompt='', edit_prompt='',
@@ -55,7 +55,7 @@ def edit(input_image, input_image_prompt='', target_prompt='', edit_prompt='',
55
  edit_guidance_scale=8, guidance_scale=15, skip=36, num_diffusion_steps=100,
56
  ):
57
  offsets=(0,0,0,0)
58
- x0 = load_512(input_image, *offsets, device).type(torch.float16)
59
 
60
 
61
  # invert
 
45
  # load pipelines
46
  sd_model_id = "runwayml/stable-diffusion-v1-5"
47
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
48
+ sd_pipe = StableDiffusionPipeline.from_pretrained(sd_model_id).to(device)
49
  sd_pipe.scheduler = DDIMScheduler.from_config(sd_model_id, subfolder = "scheduler")
50
+ sem_pipe = SemanticStableDiffusionPipeline.from_pretrained(sd_model_id).to(device)
51
 
52
 
53
  def edit(input_image, input_image_prompt='', target_prompt='', edit_prompt='',
 
55
  edit_guidance_scale=8, guidance_scale=15, skip=36, num_diffusion_steps=100,
56
  ):
57
  offsets=(0,0,0,0)
58
+ x0 = load_512(input_image, *offsets, device)
59
 
60
 
61
  # invert