-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Final phase of source tree restructure #2833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is the first phase of a big shifting of files and directories in the source tree. You will need to run `pip install -e .` before the code will work again! Here's what's in the current commit: 1) Remove a lot of dead code that dealt with checkpoint and safetensor loading. 2) Entire ckpt_generator hierarchy is now gone! 3) ldm.invoke.generator.* => invokeai.generator.* 4) ldm.model.* => invokeai.model.* 5) ldm.invoke.model_manager => invokeai.model.model_manager 6) In addition, a number of frequently-accessed classes can be imported from the invokeai.model and invokeai.generator modules: from invokeai.generator import ( Generator, PipelineIntermediateState, StableDiffusionGeneratorPipeline, infill_methods) from invokeai.models import ( ModelManager, SDLegacyType InvokeAIDiffuserComponent, AttentionMapSaver, DDIMSampler, KSampler, PLMSSampler, PostprocessingSettings )
|
Sounds like frontend files may not be moving? |
oh, you're right. all good |
The identity of the files remains intact through organization and |
Looks like some |
It feels like the Stable Diffusion code should probably go in its own module under the backend folder, to keep it separate from app code (e.g. CLI or API). I noticed this most in the Then you could have Two popular templates are roughly organized this way: |
Removed |
How about |
Things are moving around a bunch already. No better time to change names. Might be a good idea to separate from the |
Diffusers are implementing latent diffusion models, so I think we can legitimately keep the |
as i said in discord, just gonna hit "approve" on this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new structure makes a lot of sense 💯 👍
Could you undo the auto code formatting on at least the invocations (and add whatever needs to be added to avoid it)? It changed this: prompt: Optional[str] = Field(description="The prompt to generate an image from")
seed: int = Field(default=-1, ge=-1, le=np.iinfo(np.uint32).max, description="The seed to use (-1 for a random seed)")
steps: int = Field(default=10, gt=0, description="The number of steps to use to generate the image")
width: int = Field(default=512, multiple_of=64, gt=0, description="The width of the resulting image")
height: int = Field(default=512, multiple_of=64, gt=0, description="The height of the resulting image")
cfg_scale: float = Field(default=7.5, gt=0, description="The Classifier-Free Guidance, higher values may result in a result closer to the prompt")
sampler_name: SAMPLER_NAME_VALUES = Field(default="k_lms", description="The sampler to use")
seamless: bool = Field(default=False, description="Whether or not to generate an image that can tile without seams")
model: str = Field(default='', description="The model to use (currently ignored)")
progress_images: bool = Field(default=False, description="Whether or not to produce progress images during generation") Into this: prompt: Optional[str] = Field(description="The prompt to generate an image from")
seed: int = Field(
default=-1,
ge=-1,
le=np.iinfo(np.uint32).max,
description="The seed to use (-1 for a random seed)",
)
steps: int = Field(
default=10, gt=0, description="The number of steps to use to generate the image"
)
width: int = Field(
default=512,
multiple_of=64,
gt=0,
description="The width of the resulting image",
)
height: int = Field(
default=512,
multiple_of=64,
gt=0,
description="The height of the resulting image",
)
cfg_scale: float = Field(
default=7.5,
gt=0,
description="The Classifier-Free Guidance, higher values may result in a result closer to the prompt",
)
sampler_name: SAMPLER_NAME_VALUES = Field(
default="k_lms", description="The sampler to use"
)
seamless: bool = Field(
default=False,
description="Whether or not to generate an image that can tile without seams",
)
model: str = Field(default="", description="The model to use (currently ignored)")
progress_images: bool = Field(
default=False,
description="Whether or not to produce progress images during generation",
) IMO I prefer the original formatting. Especially since the latter isn't even consistent (e.g. |
It's also a nitpick, but a lot of what's in |
My thinking on this was to do the |
Done. Note that the way to disable autoformatting is like this:
|
Do you mind hitting the rest of the invocations as well? E.g. the Img2Img one. Ack looks like I was too late x.x |
Oh shoot. I thought all the invocations were at the bottom of the files. Will make a PR. |
@lstein fresh install on main when creating a image in txt2image (works fine on unified canvas and img2img)
|
All python code has been moved under
invokeai
. All vestiges ofldm
andldm.invoke
are now gone.You will need to run
pip install -e .
before the code will work again!Everything seems to be functional, but extensive testing is advised.
A guide to where the files have gone is forthcoming.