Instructions to use bartar/prci with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bartar/prci with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("bartar/prci") prompt = "Photorealistic photo of prci, gray nissan qashqai, standing on a grey brick pavement, trees and blue sky in the background. Taken by phone" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 1,568 Bytes
1b5c2a5 | 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | from huggingface_hub import HfApi, login
import os
import time
import sys
def upload_to_huggingface(repo_name, wait_minutes):
# Convert minutes to seconds and wait
print(f"Script will upload files in {wait_minutes} minutes...")
time.sleep(wait_minutes * 60)
# Initialize Hugging Face API
api = HfApi()
try:
# Authenticate using your Hugging Face API token
hf_token = os.getenv("HF_API_TOKEN")
if not hf_token:
raise ValueError("Hugging Face API token is not set. Please set it in the environment variable 'HF_API_TOKEN'.")
login(token=hf_token)
api.create_repo(repo_id=repo_name, private=True, exist_ok=True)
# Get current directory
current_dir = os.getcwd()
print("Starting upload to Hugging Face...")
# Upload all files from current directory
api.upload_folder(
folder_path=current_dir,
repo_id=repo_name,
repo_type="model"
)
print("Upload completed successfully!")
except Exception as e:
print(f"An error occurred: {str(e)}")
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: python script.py <repository_name> <minutes_to_wait>")
print("Example: python script.py 'your-username/model-name' 120")
sys.exit(1)
repo_name = sys.argv[1]
wait_minutes = int(sys.argv[2])
upload_to_huggingface(repo_name, wait_minutes)
|