"torchvision/vscode:/vscode.git/clone" did not exist on "11da4f17b7d704ee7ae8de4f8d3a3599bc05f4f6"
Unverified Commit 511bd3aa authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

[example/image2image] raise error if strength is not in desired range (#238)

raise error if strength is not in desired range
parent 4674fdf8
......@@ -64,6 +64,9 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
else:
raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}")
if strength < 0 or strength > 1:
raise ValueError(f"The value of strength should in [0.0, 1.0] but is {strength}")
# set timesteps
accepts_offset = "offset" in set(inspect.signature(self.scheduler.set_timesteps).parameters.keys())
extra_set_kwargs = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment