You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Command to run save: python test_pipe_compile_save_load.py --save# Command to run load: python test_pipe_compile_save_load.py --loadimportargparseimporttorchfromdiffusersimportStableDiffusionXLPipelinefromonediffximportcompile_pipe, save_pipe, load_pipeparser=argparse.ArgumentParser()
parser.add_argument(
"--model", type=str, default="stabilityai/stable-diffusion-xl-base-1.0"
)
parser.add_argument("--save", action=argparse.BooleanOptionalAction)
parser.add_argument("--load", action=argparse.BooleanOptionalAction)
cmd_args=parser.parse_args()
importtimestart=time.perf_counter()
pipe=StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
pipe.to("cuda")
# compile the pipepipe=compile_pipe(pipe)
ifcmd_args.load:
# load the compiled pipeload_pipe(pipe, dir="cached_pipe")
# If the pipe is not loaded, it will takes seconds to do real compilation.# If the pipe is loaded, it will run fast.image=pipe(
prompt="street style, detailed, raw photo, woman, face, shot on CineStill 800T",
height=512,
width=512,
num_inference_steps=30,
output_type="pil",
).imagesprint(f"Time taken: {time.perf_counter()-start} seconds")
image[0].save(f"test_image.png")
ifcmd_args.save:
# save the compiled pipesave_pipe(pipe, dir="cached_pipe")
logs:
python save_and_load.py --save ─╯
/home/ws/miniconda3/envs/of/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 9.88it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:37<00:00, 1.24s/it]
Time taken: 63.03123291092925 seconds
╰─ python save_and_load.py --load
/home/ws/miniconda3/envs/of/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 9.73it/s]
WARNING [2024-07-19 15:49:26] /home/ws/miniconda3/envs/of/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/args_tree_util.py:59 - Input structure key None to b47b96 has changed. Resetting the deployable module graph. This may slow down the process.
WARNING [2024-07-19 15:49:29] /home/ws/miniconda3/envs/of/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/args_tree_util.py:59 - Input structure key None to b47b96 has changed. Resetting the deployable module graph. This may slow down the process.
0%| | 0/30 [00:00<?, ?it/s]WARNING [2024-07-19 15:49:38] /home/ws/miniconda3/envs/of/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/args_tree_util.py:59 - Input structure key None to 32274a has changed. Resetting the deployable module graph. This may slow down the process.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:36<00:00, 1.21s/it]
WARNING [2024-07-19 15:50:14] /home/ws/miniconda3/envs/of/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/args_tree_util.py:59 - Input structure key None to c4612e has changed. Resetting the deployable module graph. This may slow down the process.
Time taken: 66.22534257895313 seconds
The text was updated successfully, but these errors were encountered:
Describe the bug
when i test onediffx diffusers save_and_load example. There's some warnings show
and the time cost nearly equal to onediff online compilation 66s(load_pipe) compare to 63s(online compile)
Your environment
OneDiff git commit id
OneFlow version info if you have installed oneflow
How To Reproduce
The code
logs:
The text was updated successfully, but these errors were encountered: