Spaces:
Runtime error
Runtime error
ZeroGPU (#2)
Browse files- ZeroGPU (e5a31dcb62db3654b083560c8dab63a08c661cce)
Co-authored-by: Charles Bensimon <cbensimon@users.noreply.huggingface.co>
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)
|