mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
d5a75eb833
At some point I typo'd this and set the max seed to signed int32 max. It should be *un*signed int32 max. This restored the seed range to what it was in v2.3.
22 lines
457 B
Python
22 lines
457 B
Python
import datetime
|
|
import numpy as np
|
|
|
|
|
|
def get_timestamp():
|
|
return int(datetime.datetime.now(datetime.timezone.utc).timestamp())
|
|
|
|
|
|
def get_iso_timestamp() -> str:
|
|
return datetime.datetime.utcnow().isoformat()
|
|
|
|
|
|
def get_datetime_from_iso_timestamp(iso_timestamp: str) -> datetime.datetime:
|
|
return datetime.datetime.fromisoformat(iso_timestamp)
|
|
|
|
|
|
SEED_MAX = np.iinfo(np.uint32).max
|
|
|
|
|
|
def get_random_seed():
|
|
return np.random.randint(0, SEED_MAX)
|