Skip to content
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

treating sampler types like lists via command line? #73

Closed
Cybergate9 opened this issue Oct 24, 2022 · 6 comments
Closed

treating sampler types like lists via command line? #73

Cybergate9 opened this issue Oct 24, 2022 · 6 comments

Comments

@Cybergate9
Copy link

Cybergate9 commented Oct 24, 2022

just another suggestion..
interesting testing with same prompt + seed with different sampler types led to a thought that having the option for 'each', or 'series' (ddim+plms), or 'random' options on --sampler-type might come in handy..

not sure what syntax would be consistent with command line options but maybe using {} or _option_ as per prompt syntaxes might work e.g.:
_each_ = do 1 each of sampler types available (currently 10, thereby creating ten images)
_random_ = choose 1 sampler randomly
'+ syntax' for 'series' thereby "--sampler-type ddim + plms + k_huen" = step through sampler series list thereby creating three images
or maybe [] easier to parse, e.g. --sampler-type [ddim plms k_huen]

not sure, leave as whether a sensible/useful idea, and implementation details, for you to decide :-)

@brycedrennan
Copy link
Owner

This sounds like a more advanced use case then I'd want to support at the command line. I'd suggest just moving to the python interface at that point.

Untested code but you get the idea:

from imaginairy import ImaginePrompt, imagine_image_files
from imaginairy.samplers.base import SAMPLER_TYPE_OPTIONS

def main():
  prompt_text = "a dolphin"
  prompts = []
  for sampler_type in SAMPLER_TYPE_OPTIONS:
      prompt = ImaginePrompt(
          prompt_text, width=512, height=512, steps=20, seed=1, sampler_type=sampler_type
      )
      prompts.append(prompt)
  
  imagine_image_files(prompts, outdir="output")

if __name__ == "__main__":
    main()

@Cybergate9
Copy link
Author

great thanks!

@Cybergate9
Copy link
Author

incidentally it possible/desirable to suppress the error/warning messages that happen when using script like above?

e.g. it spews out a pile of warnings starting with:

Some weights of the model checkpoint at openai/clip-vit-large-patch14 were not used when initializing CLIPTextModel:
... [ends with]
- This IS expected if you are initializing CLIPTextModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing CLIPTextModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).

@brycedrennan
Copy link
Owner

from imaginairy.log_utils import configure_logging
configure_logging()

@Cybergate9
Copy link
Author

thanks again! will leave you alone for today :-)

@brycedrennan
Copy link
Owner

yeah no worries - thanks for all the great feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants