Spaces:
Running
on
Zero
Running
on
Zero
AutoPipelineForText2Image for all
Browse files- check_app.py +6 -15
check_app.py
CHANGED
@@ -97,21 +97,12 @@ def create_pipeline_logic(prompt_text, model_name):
|
|
97 |
seed = 42
|
98 |
config = MODEL_CONFIGS[model_name]
|
99 |
pipe_class = config["pipeline_class"]
|
100 |
-
pipe =
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
#cache_dir=config["cache_dir"],
|
107 |
-
torch_dtype=torch.bfloat16
|
108 |
-
).to("cuda")
|
109 |
-
else:
|
110 |
-
pipe = pipe_class.from_pretrained(
|
111 |
-
config["repo_id"],
|
112 |
-
#cache_dir=config["cache_dir"],
|
113 |
-
torch_dtype=torch.bfloat16
|
114 |
-
).to("cuda")
|
115 |
|
116 |
image = generate_image_with_progress(
|
117 |
pipe, prompt_text, num_steps=num_steps, guidance_scale=guidance_scale, seed=seed, progress=progress
|
|
|
97 |
seed = 42
|
98 |
config = MODEL_CONFIGS[model_name]
|
99 |
pipe_class = config["pipeline_class"]
|
100 |
+
pipe = AutoPipelineForText2Image.from_pretrained(
|
101 |
+
config["repo_id"],
|
102 |
+
variant="fp16",
|
103 |
+
#cache_dir=config["cache_dir"],
|
104 |
+
torch_dtype=torch.bfloat16
|
105 |
+
).to("cuda")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
image = generate_image_with_progress(
|
108 |
pipe, prompt_text, num_steps=num_steps, guidance_scale=guidance_scale, seed=seed, progress=progress
|