Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Sep 13, 2024
1 parent 7805b6c commit 0497891
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions horde/bridge_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def check_bridge_capability(capability, bridge_agent):
checked_semver = semver.Version.parse(str(version), True)
if checked_semver.compare(bridge_version) <= 0:
total_capabilities.update(BRIDGE_CAPABILITIES[bridge_name][version])
logger.debug([total_capabilities, capability, capability in total_capabilities])
logger.debug([bridge_name, BRIDGE_CAPABILITIES[bridge_name]])
# logger.debug([total_capabilities, capability, capability in total_capabilities])
# logger.debug([bridge_name, BRIDGE_CAPABILITIES[bridge_name]])
return capability in total_capabilities


Expand Down
2 changes: 0 additions & 2 deletions horde/classes/stable/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ def can_generate(self, waiting_prompt):
if "flux_1" in model_reference.get_all_model_baselines(self.get_model_names()) and not check_bridge_capability(
"flux", self.bridge_agent
):
logger.debug('flux')
return [False, "bridge_version"]
logger.debug('test')
if waiting_prompt.params.get("clip_skip", 1) > 1 and not check_bridge_capability(
"clip_skip",
self.bridge_agent,
Expand Down
12 changes: 8 additions & 4 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def test_simple_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None:
assert retrieve_results["kudos"] > 1
assert retrieve_results["done"] is True

TEST_MODELS_FLUX = ["Flux.1-Schnell fp8 (Compact)"]



def test_flux_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None:
headers = {"apikey": api_key, "Client-Agent": f"aihorde_ci_client:{CIVERSION}:(discord)db0#1625"} # ci/cd user
async_dict = {
Expand All @@ -111,7 +115,7 @@ def test_flux_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None:
"cfg_scale": 1,
"sampler_name": "k_euler",
},
"models": ["Flux.1-Schnell fp8 (Compact)"],
"models": TEST_MODELS_FLUX,
# "extra_slow_workers": True,
}
protocol = "http"
Expand All @@ -124,8 +128,8 @@ def test_flux_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None:
print(async_results)
pop_dict = {
"name": "CICD Fake Dreamer",
"models": ["Flux.1-Schnell fp8 (Compact)"],
"bridge_agent": "AI Horde Worker reGen:9.0.0:https://github.com/Haidra-Org/horde-worker-reGen",
"models": TEST_MODELS_FLUX,
"bridge_agent": "AI Horde Worker reGen:9.0.0-citests:https://github.com/Haidra-Org/horde-worker-reGen",
"nsfw": True,
"amount": 10,
"max_pixels": 4194304,
Expand Down Expand Up @@ -176,7 +180,7 @@ def test_flux_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None:
assert len(gen["gen_metadata"]) == 0
assert gen["seed"] == "0"
assert gen["worker_name"] == "CICD Fake Dreamer"
assert gen["model"] in TEST_MODELS
assert gen["model"] in TEST_MODELS_FLUX
assert gen["state"] == "ok"
assert retrieve_results["kudos"] > 1
assert retrieve_results["done"] is True
Expand Down

0 comments on commit 0497891

Please sign in to comment.