Diffusers documentation

Trạng thái Pipeline

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Trạng thái Pipeline

PipelineState

lớp diffusers.modular_pipelines.PipelineState

< >

( values: dict[str, typing.Any] = <factory>kwargs_mapping: dict[str, list[str]] = <factory> )

PipelineState lưu trữ trạng thái của một pipeline. Nó được dùng để truyền dữ liệu giữa các khối pipeline.

get

< >

( keys: str | list[str]default: Any = None ) → Any | dict[str, Any]

Tham số

  • keys (str | list[str]) — Khóa hoặc danh sách các khóa cho các giá trị
  • default (Any) — Giá trị mặc định để trả về nếu không tìm thấy

Trả về

Bất kỳ | dict[str, Any]

Giá trị đơn nếu keys là str, từ điển các giá trị nếu keys là list

Lấy một hoặc nhiều giá trị từ trạng thái pipeline.

get_by_kwargs

< >

( kwargs_type: str ) → dict[str, Any]

Tham số

  • kwargs_type (str) — kwargs_type để lọc

Trả về

dict[str, Any]

Từ điển các giá trị có kwargs_type khớp

Lấy tất cả các giá trị có kwargs_type khớp.

set

< >

( key: strvalue: Anykwargs_type: str = None )

Tham số

  • key (str) — Khóa cho giá trị
  • value (Any) — Giá trị cần lưu trữ
  • kwargs_type (str) — kwargs_type mà giá trị được liên kết

Thêm một giá trị vào trạng thái pipeline.

to_dict

< >

( )

Chuyển đổi PipelineState thành một từ điển.

BlockState

lớp diffusers.modular_pipelines.BlockState

< >

( **kwargs )

Container cho dữ liệu trạng thái khối với khả năng truy cập thuộc tính và biểu diễn định dạng.

as_dict

< >

( ) → dict[str, Any]

Trả về

dict[str, Any]

Từ điển chứa tất cả các thuộc tính của BlockState

Chuyển đổi BlockState thành một từ điển.

Update on GitHub