Your go-to solution for generating fire images with HuggingFace's models! Both sync and async support! 🚀
- 🎨 Support for all HuggingFace image models
- ⚡ Both sync and async implementations
- 🔄 Smart retry mechanism
- 🌐 Proxy support
- 📝 Comprehensive logging
- 🎯 Type hints
- 🚀 Easy to use
pip install webscout
from webscout import HFimager
# Initialize with your API key
provider = HFimager(api_token="your-hf-token")
# Generate a single image
images = provider.generate("A shiny red sports car")
paths = provider.save(images)
# Generate multiple images with parameters
images = provider.generate(
prompt="Epic dragon in cyberpunk city",
amount=3,
model="runwayml/stable-diffusion-v1-5",
guidance_scale=7.5,
negative_prompt="blurry, bad quality",
num_inference_steps=50,
width=768,
height=768
)
paths = provider.save(images, name="dragon", dir="outputs")
from webscout import AsyncHFimager
import asyncio
async def example():
# Initialize with your API key
provider = AsyncHFimager(api_token="your-hf-token")
# Generate a single image
images = await provider.generate("A shiny red sports car")
paths = await provider.save(images)
# Generate multiple images with parameters
images = await provider.generate(
prompt="Epic dragon in cyberpunk city",
amount=3,
model="runwayml/stable-diffusion-v1-5",
guidance_scale=7.5,
negative_prompt="blurry, bad quality",
num_inference_steps=50,
width=768,
height=768
)
paths = await provider.save(images, name="dragon", dir="outputs")
# Run the example
asyncio.run(example())
stabilityai/stable-diffusion-xl-base-1.0
(default)runwayml/stable-diffusion-v1-5
CompVis/stable-diffusion-v1-4
stabilityai/sdxl-turbo
- And many more! 🎉
api_token
: Your HuggingFace API tokentimeout
: Request timeout in secondsproxies
: Proxy settings for requests
prompt
: Your image descriptionamount
: Number of images to generatemodel
: Which model to useguidance_scale
: Control how much to follow your promptnegative_prompt
: What you don't want in the imagenum_inference_steps
: More steps = better quality but slowerwidth
: Image widthheight
: Image heightscheduler
: Which scheduler to useseed
: Random seed for reproducibility
name
: Custom name for your imagesdir
: Where to save your imagesfilenames_prefix
: Add prefix to filenames