Skip to content

Commit

Permalink
Fix workflows to use SD sample from a new location. Added cmd line to…
Browse files Browse the repository at this point in the history
… download the adapter in README.
  • Loading branch information
slyalin committed Oct 3, 2024
1 parent b38e3ce commit daf87e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lcm_dreamshaper_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Run app
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
./build/samples/cpp/stable_diffusion/stable_diffusion ./models/lcm_dreamshaper_v7/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
./build/samples/cpp/text2image/stable_diffusion ./models/lcm_dreamshaper_v7/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
lcm_dreamshaper_v7_cpp-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Run app
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
./build/samples/cpp/stable_diffusion/Release/lcm_dreamshaper.exe ./models/lcm_dreamshaper_v7/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
./build/samples/cpp/text2image/Release/lcm_dreamshaper.exe ./models/lcm_dreamshaper_v7/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
Overall_Status:
name: ci/gha_overall_status_lcm
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/stable_diffusion_1_5_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,21 @@ jobs:
source openvino_sd_cpp/bin/activate
optimum-cli export openvino --model dreamlike-art/dreamlike-anime-1.0 --weight-format fp16 --task stable-diffusion models/dreamlike-art-dreamlike-anime-1.0/FP16
- name: Run app
- name: Run main app
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
./build/samples/cpp/stable_diffusion/stable_diffusion ./models/dreamlike-art-dreamlike-anime-1.0/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
./build/samples/cpp/text2image/stable_diffusion ./models/dreamlike-art-dreamlike-anime-1.0/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
stable_diffusion_1_5_cpp-windows:
- name: Download LoRA adapter
run: |
wget -O ./build/samples/cpp/text2image/soulcard.safetensors https://civitai.com/api/download/models/72591
- name: Run LoRA app
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
./build/samples/cpp/text2image/lora_stable_diffusion ./models/dreamlike-art-dreamlike-anime-1.0/FP16 "curly-haired unicorn in the forest, anime, line" soulcard.safetensors 0.7
stable_diffusion_1_5_cpp-windows:
runs-on: windows-latest
if: ${{ false }} # TODO: fix Windows
defaults:
Expand Down Expand Up @@ -118,7 +127,7 @@ jobs:
- name: Run app
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
./build/samples/cpp/stable_diffusion/Release/stable_diffusion.exe ./models/dreamlike-art-dreamlike-anime-1.0/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
./build/samples/cpp/text2image/Release/stable_diffusion.exe ./models/dreamlike-art-dreamlike-anime-1.0/FP16 "cyberpunk cityscape like Tokyo New York with tall buildings at dusk golden hour cinematic lighting"
Overall_Status:
name: ci/gha_overall_status_stable_diffusion
Expand Down
6 changes: 5 additions & 1 deletion samples/cpp/text2image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ Models can be downloaded from [HiggingFace](https://huggingface.co/models). This

LoRA adapters can be connected to the pipeline and modify generated images to have certain style, details or quality. Adapters are supported in Safetensors format and can be downloaded from public sources like [Civitai](https://civitai.com) or [HuggingFace](https://huggingface.co/models) or trained by the user. Adapters compatible with a base model should be used only. A weighted blend of multiple adapters can be applied by specifying multple adapter files with corresponding alpha parameters in command line. Check `lora.cpp` source code to learn how to enable adapters and specify them in each `generate` call.

Here is an example how to run the sample with a single adapter. Download adapter file from https://civitai.com/models/67927/soulcard, save it as `soulcard.safetensors` and run `lora_stable_diffusion` executable:
Here is an example how to run the sample with a single adapter. First download adapter file from https://civitai.com/models/67927/soulcard page manually and save it as `soulcard.safetensors`. Or download it from command line:

`wget -O soulcard.safetensors https://civitai.com/api/download/models/72591`

Then run `lora_stable_diffusion` executable:

`./lora_stable_diffusion dreamlike_anime_1_0_ov/FP16 'curly-haired unicorn in the forest, anime, line' soulcard.safetensors 0.7`

Expand Down

0 comments on commit daf87e7

Please sign in to comment.