add optimization to openjourney (#12423)
* add optimization to openjourney * add optimization to openjourney
This commit is contained in:
parent
145e8b480f
commit
7e0a840f74
2 changed files with 3 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ Follow the instructions in IPEX-GPU installation guides ([Linux Guide](https://i
|
|||
Assume you have created a conda environment named diffusion with ipex-llm installed. Run below commands to install dependencies for running Stable Diffusion.
|
||||
```bash
|
||||
conda activate diffusion
|
||||
pip install diffusers["torch"] transformers
|
||||
pip install diffusers["torch"]==0.31.0 transformers
|
||||
pip install -U PEFT transformers
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
from diffusers import StableDiffusionPipeline
|
||||
import torch
|
||||
import ipex_llm
|
||||
from ipex_llm import optimize_model
|
||||
import argparse
|
||||
import time
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ def main(args):
|
|||
args.repo_id_or_model_path,
|
||||
torch_dtype=torch.float16,
|
||||
use_safetensors=True)
|
||||
pipe = optimize_model(pipe, low_bit=None)
|
||||
pipe = pipe.to("xpu")
|
||||
|
||||
with torch.inference_mode():
|
||||
|
|
|
|||
Loading…
Reference in a new issue