KingNish commited on
Commit
7f9d10e
1 Parent(s): 265db6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -62,11 +62,12 @@ def set_timesteps_patched(self, num_inference_steps: int, device = None):
62
  # Image Editor
63
  edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
64
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
65
- pipe_edit = StableDiffusionXLInstructPix2PixPipeline.from_single_file( edit_file, num_in_channels=8, is_cosxl_edit=True, vae=vae, torch_dtype=torch.float16,)
66
- pipe_edit.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_edit.scheduler.config)
67
- pipe_edit.load_lora_weights("ehristoforu/dalle-3-xl-v2", weight_name="dalle-3-xl-lora-v2.safetensors", adapter_name="dalle")
 
68
  pipe_edit.load_lora_weights("KingNish/Better-Image-XL-Lora", weight_name="example-03.safetensors", adapter_name="lora")
69
- pipe_edit.set_adapters(["lora","dalle"], adapter_weights=[1.5, 0.7])
70
  pipe_edit.to("cuda")
71
 
72
  # Generator
 
62
  # Image Editor
63
  edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
64
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
65
+ pipe_edit = StableDiffusionXLInstructPix2PixPipeline.from_single_file(
66
+ edit_file, num_in_channels=8, is_cosxl_edit=True, vae=vae, torch_dtype=torch.float16,
67
+ )
68
+ pipe_edit.scheduler = EDMEulerScheduler(sigma_min=0.002, sigma_max=120.0, sigma_data=1.0, prediction_type="v_prediction")
69
  pipe_edit.load_lora_weights("KingNish/Better-Image-XL-Lora", weight_name="example-03.safetensors", adapter_name="lora")
70
+ pipe_edit.set_adapters(["lora"])
71
  pipe_edit.to("cuda")
72
 
73
  # Generator