Update README.md
Browse files
README.md
CHANGED
|
@@ -52,10 +52,8 @@ from schedulers.lcm_single_step_scheduler import LCMSingleStepScheduler
|
|
| 52 |
from module.ip_adapter.utils import load_adapter_to_pipe
|
| 53 |
from pipelines.sdxl_instantir import InstantIRPipeline
|
| 54 |
|
| 55 |
-
# prepare models under ./
|
| 56 |
-
|
| 57 |
-
previewer_lora_path = f'./models'
|
| 58 |
-
instantir_path = f'./models/aggregator.pt'
|
| 59 |
|
| 60 |
# load pretrained models
|
| 61 |
pipe = InstantIRPipeline.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', torch_dtype=torch.float16)
|
|
@@ -63,17 +61,17 @@ pipe = InstantIRPipeline.from_pretrained('stabilityai/stable-diffusion-xl-base-1
|
|
| 63 |
# load adapter
|
| 64 |
load_adapter_to_pipe(
|
| 65 |
pipe,
|
| 66 |
-
|
| 67 |
image_encoder_or_path = 'facebook/dinov2-large',
|
| 68 |
)
|
| 69 |
|
| 70 |
# load previewer lora
|
| 71 |
-
pipe.prepare_previewers(
|
| 72 |
pipe.scheduler = DDPMScheduler.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', subfolder="scheduler")
|
| 73 |
lcm_scheduler = LCMSingleStepScheduler.from_config(pipe.scheduler.config)
|
| 74 |
|
| 75 |
# load aggregator weights
|
| 76 |
-
pretrained_state_dict = torch.load(instantir_path)
|
| 77 |
pipe.aggregator.load_state_dict(pretrained_state_dict)
|
| 78 |
|
| 79 |
# send to GPU and fp16
|
|
|
|
| 52 |
from module.ip_adapter.utils import load_adapter_to_pipe
|
| 53 |
from pipelines.sdxl_instantir import InstantIRPipeline
|
| 54 |
|
| 55 |
+
# prepare models under ./models
|
| 56 |
+
instantir_path = f'./models'
|
|
|
|
|
|
|
| 57 |
|
| 58 |
# load pretrained models
|
| 59 |
pipe = InstantIRPipeline.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', torch_dtype=torch.float16)
|
|
|
|
| 61 |
# load adapter
|
| 62 |
load_adapter_to_pipe(
|
| 63 |
pipe,
|
| 64 |
+
f"{instantir_path}/adapter.pt",
|
| 65 |
image_encoder_or_path = 'facebook/dinov2-large',
|
| 66 |
)
|
| 67 |
|
| 68 |
# load previewer lora
|
| 69 |
+
pipe.prepare_previewers(instantir_path)
|
| 70 |
pipe.scheduler = DDPMScheduler.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', subfolder="scheduler")
|
| 71 |
lcm_scheduler = LCMSingleStepScheduler.from_config(pipe.scheduler.config)
|
| 72 |
|
| 73 |
# load aggregator weights
|
| 74 |
+
pretrained_state_dict = torch.load(f"{instantir_path}/aggregator.pt")
|
| 75 |
pipe.aggregator.load_state_dict(pretrained_state_dict)
|
| 76 |
|
| 77 |
# send to GPU and fp16
|