mirror of
https://github.com/Stability-AI/generative-models.git
synced 2026-02-02 04:14:27 +01:00
fix for orig dimensions
This commit is contained in:
@@ -32,28 +32,27 @@ def init_st(
|
||||
enable_swap=True,
|
||||
) -> Dict[str, Any]:
|
||||
state: Dict[str, Any] = dict()
|
||||
if not "model" in state:
|
||||
config = spec.config
|
||||
ckpt = spec.ckpt
|
||||
config = spec.config
|
||||
ckpt = spec.ckpt
|
||||
|
||||
if enable_swap:
|
||||
pipeline = SamplingPipeline(
|
||||
model_spec=spec,
|
||||
use_fp16=use_fp16,
|
||||
device=CudaModelManager(device="cuda", swap_device="cpu"),
|
||||
)
|
||||
else:
|
||||
pipeline = SamplingPipeline(model_spec=spec, use_fp16=use_fp16)
|
||||
if enable_swap:
|
||||
pipeline = SamplingPipeline(
|
||||
model_spec=spec,
|
||||
use_fp16=use_fp16,
|
||||
device=CudaModelManager(device="cuda", swap_device="cpu"),
|
||||
)
|
||||
else:
|
||||
pipeline = SamplingPipeline(model_spec=spec, use_fp16=use_fp16)
|
||||
|
||||
state["spec"] = spec
|
||||
state["model"] = pipeline
|
||||
state["ckpt"] = ckpt if load_ckpt else None
|
||||
state["config"] = config
|
||||
state["params"] = SamplingParams()
|
||||
if load_filter:
|
||||
state["filter"] = DeepFloydDataFiltering(verbose=False)
|
||||
else:
|
||||
state["filter"] = None
|
||||
state["spec"] = spec
|
||||
state["model"] = pipeline
|
||||
state["ckpt"] = ckpt if load_ckpt else None
|
||||
state["config"] = config
|
||||
state["params"] = SamplingParams()
|
||||
if load_filter:
|
||||
state["filter"] = DeepFloydDataFiltering(verbose=False)
|
||||
else:
|
||||
state["filter"] = None
|
||||
return state
|
||||
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ class SamplingParams:
|
||||
aesthetic_score: float = 6.0
|
||||
negative_aesthetic_score: float = 2.5
|
||||
img2img_strength: float = 1.0
|
||||
orig_width: int = 1024
|
||||
orig_height: int = 1024
|
||||
orig_width: int = width
|
||||
orig_height: int = height
|
||||
crop_coords_top: int = 0
|
||||
crop_coords_left: int = 0
|
||||
sigma_min: float = 0.0292
|
||||
@@ -301,6 +301,8 @@ class SamplingPipeline:
|
||||
value_dict["negative_prompt"] = negative_prompt
|
||||
value_dict["target_width"] = width
|
||||
value_dict["target_height"] = height
|
||||
value_dict["orig_width"] = width
|
||||
value_dict["orig_height"] = height
|
||||
return do_img2img(
|
||||
image,
|
||||
self.model,
|
||||
|
||||
Reference in New Issue
Block a user