Rubbrband detects deformities in your images generated by Stable Diffusion at scale.
pip install rubbrband
import rubbrband
rubbrband.init("YOUR_API_KEY")
evals = rubbrband.eval("https://example.com/image.png", prompt="Prompt used to generate image")
- Using a URL
evals = rubbrband.eval(image="https://example.com/image.png", prompt="Prompt used to generate image")
- Using a PIL Image
from PIL import Image
evals = rubbrband.eval(image=Image.open("/path/to/image.png"), prompt="Prompt used to generate image")
- Using a path
evals = rubbrband.eval(image="/path/to/image.png", prompt="Prompt used to generate image")
- Using a context manager
with open("/path/to/image.png", "rb") as f:
evals = rubbrband.eval(image=f, prompt="Prompt used to generate image")
Rubbrband client library by default returns the is_deformed
feature, which returns either True
or False
.
Other available features are ["nsfw"]
.
response = rubbrband.eval(
"https://replicate.delivery/mgxm/85f53415-0dc7-4703-891f-1e6f912119ad/output.png",
prompt="A woman wearing a strange hat",
"features": ["nsfw"]
)
nsfw = response["nsfw_detected"]