File size: 844 Bytes
38ab39c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from huggingface_hub import InferenceClient
from dotenv import load_dotenv
import os

load_dotenv()
token = os.getenv("HF_API_TOKEN")

models_to_test = [
    "RunDiffusion/Juggernaut-XL-Lightning", # Top choice for quality/speed
    "stabilityai/stable-diffusion-xl-base-1.0", # Reliable baseline
    "playgroundai/playground-v2.5-1024px-aesthetic" # High aesthetic
]

prompt = "A detailed historical copperplate engraving of a steam engine"

print("--- Testing Model Availability ---")
for model in models_to_test:
    print(f"\nTesting: {model}")
    client = InferenceClient(model=model, token=token)
    try:
        image = client.text_to_image(prompt)
        print("SUCCESS! Model is available.")
        image.save(f"test_{model.replace('/', '_')}.png")
    except Exception as e:
        print(f"FAILED: {e}")