Upload nunchaku-tech_nunchaku-flux.1-krea-dev_0.py with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829# /// script# requires-python = ">=3.12"# dependencies = [# "transformers",# "torch",# ]# ///
try: from diffusers import DiffusionPipeline pipe = DiffusionPipeline.from_pretrained("nunchaku-tech/nunchaku-flux.1-krea-dev") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] with open('nunchaku-tech_nunchaku-flux.1-krea-dev_0.txt', 'w') as f: f.write('Everything was good in nunchaku-tech_nunchaku-flux.1-krea-dev_0.txt')except Exception as e: with open('nunchaku-tech_nunchaku-flux.1-krea-dev_0.txt', 'w') as f: import traceback traceback.print_exc(file=f)finally: from huggingface_hub import upload_file upload_file( path_or_fileobj='nunchaku-tech_nunchaku-flux.1-krea-dev_0.txt', repo_id='model-metadata/custom_code_execution_files', path_in_repo='nunchaku-tech_nunchaku-flux.1-krea-dev_0.txt', repo_type='dataset', )nunchaku-tech_nunchaku-flux.1-krea-dev_0.pyAdded+29