Spaces:
Running
on
Zero
Running
on
Zero
ZeroGPU
Browse files- `id_encoder` needs to be manually moved to CUDA because of how diffusers and ZeroGPU interoperate
Compatibility between ZeroGPU and diffusers should be improved in the future
- `enable_queue` now defaults to `True`!
app.py
CHANGED
@@ -36,12 +36,13 @@ pipe.load_photomaker_adapter(
|
|
36 |
weight_name=os.path.basename(photomaker_ckpt),
|
37 |
trigger_word="img"
|
38 |
)
|
|
|
39 |
|
40 |
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
41 |
# pipe.set_adapters(["photomaker"], adapter_weights=[1.0])
|
42 |
pipe.fuse_lora()
|
43 |
|
44 |
-
@spaces.GPU
|
45 |
def generate_image(upload_images, prompt, negative_prompt, style_name, num_steps, style_strength_ratio, num_outputs, guidance_scale, seed, progress=gr.Progress(track_tqdm=True)):
|
46 |
# check the trigger word
|
47 |
image_token_id = pipe.tokenizer.convert_tokens_to_ids(pipe.trigger_word)
|
|
|
36 |
weight_name=os.path.basename(photomaker_ckpt),
|
37 |
trigger_word="img"
|
38 |
)
|
39 |
+
pipe.id_encoder.to(device)
|
40 |
|
41 |
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
42 |
# pipe.set_adapters(["photomaker"], adapter_weights=[1.0])
|
43 |
pipe.fuse_lora()
|
44 |
|
45 |
+
@spaces.GPU
|
46 |
def generate_image(upload_images, prompt, negative_prompt, style_name, num_steps, style_strength_ratio, num_outputs, guidance_scale, seed, progress=gr.Progress(track_tqdm=True)):
|
47 |
# check the trigger word
|
48 |
image_token_id = pipe.tokenizer.convert_tokens_to_ids(pipe.trigger_word)
|