Upload scripts/generate_sampler_step_scales.py with huggingface_hub
Browse files
scripts/generate_sampler_step_scales.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import argparse
|
| 2 |
+
import torch
|
| 3 |
+
import os
|
| 4 |
+
from diffusers import StableDiffusionPipeline
|
| 5 |
+
import sys
|
| 6 |
+
|
| 7 |
+
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 8 |
+
# add project root to path
|
| 9 |
+
sys.path.append(PROJECT_ROOT)
|
| 10 |
+
|
| 11 |
+
SAMPLER_SCALES_ROOT = os.path.join(PROJECT_ROOT, 'toolkit', 'samplers_scales')
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
parser = argparse.ArgumentParser(description='Process some images.')
|
| 15 |
+
add_arg = parser.add_argument
|
| 16 |
+
add_arg('--model', type=str, required=True, help='Path to model')
|
| 17 |
+
add_arg('--sampler', type=str, required=True, help='Name of sampler')
|
| 18 |
+
|
| 19 |
+
args = parser.parse_args()
|
| 20 |
+
|