Skip to content

Commit 0f95b35

Browse files
committed
chore(tests): full/quick for test_lora_http_download_civitai_safetns
1 parent 0cb839d commit 0f95b35

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

tests/integration/test_loras.py

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,41 @@ def test_lora_http_download_pytorch_bin(self):
7575

7676
# These formats are not supported by diffusers yet :(
7777
def test_lora_http_download_civitai_safetensors(self):
78-
result = runTest(
79-
"txt2img",
80-
self.TEST_ARGS,
81-
{
82-
"MODEL_ID": "runwayml/stable-diffusion-v1-5",
83-
"MODEL_REVISION": "fp16",
84-
"MODEL_PRECISION": "fp16",
85-
# https://civitai.com/models/5373/makima-chainsaw-man-lora
86-
"lora_weights": "https://civitai.com/api/download/models/6244#fname=makima_offset.safetensors",
87-
"safety_checker": False,
88-
},
89-
{
90-
"num_inference_steps": 1,
91-
"prompt": "masterpiece, (photorealistic:1.4), best quality, beautiful lighting, (ulzzang-6500:0.5), makima \(chainsaw man\), (red hair)+(long braided hair)+(bangs), yellow eyes, golden eyes, ((ringed eyes)), (white shirt), (necktie), RAW photo, 8k uhd, film grain",
92-
"seed": 1,
93-
},
94-
)
78+
quickTest = True
79+
80+
callInputs = {
81+
"MODEL_ID": "NED-v1-22",
82+
# https://civitai.com/models/10028/neverending-dream-ned?modelVersionId=64094
83+
"CHECKPOINT_URL": "https://civitai.com/api/download/models/64094#fname=neverendingDreamNED_v122BakedVae.safetensors",
84+
"MODEL_PRECISION": "fp16",
85+
# https://civitai.com/models/5373/makima-chainsaw-man-lora
86+
"lora_weights": "https://civitai.com/api/download/models/6244#fname=makima_offset.safetensors",
87+
"safety_checker": False,
88+
}
89+
modelInputs = {
90+
# https://civitai.com/images/709482
91+
"num_inference_steps": 30,
92+
"prompt": "masterpiece, (photorealistic:1.4), best quality, beautiful lighting, (ulzzang-6500:0.5), makima \(chainsaw man\), (red hair)+(long braided hair)+(bangs), yellow eyes, golden eyes, ((ringed eyes)), (white shirt), (necktie), RAW photo, 8k uhd, film grain",
93+
"negative_prompt": "(painting by bad-artist-anime:0.9), (painting by bad-artist:0.9), watermark, text, error, blurry, jpeg artifacts, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, artist name, (worst quality, low quality:1.4), bad anatomy",
94+
"width": 584,
95+
"height": 880,
96+
"seed": 2281759351,
97+
"guidance_scale": 9,
98+
}
99+
100+
if quickTest:
101+
callInputs.update(
102+
{
103+
# i.e. use a model we already have
104+
"MODEL_ID": "runwayml/stable-diffusion-v1-5",
105+
"MODEL_REVISION": "fp16",
106+
}
107+
)
108+
modelInputs.update(
109+
{
110+
"num_inference_steps": 1,
111+
}
112+
)
113+
result = runTest("txt2img", self.TEST_ARGS, callInputs, modelInputs)
95114

96115
assert result["image_base64"]

0 commit comments

Comments
 (0)